If you put the ResourceParams stuff in server.xml as GlobalResource,
you must put e.g. this into your server.xml's context respectively your myapp.xml context descriptor.


<ResourceLink name="jdbc/myapp" global="jdbc/myapp" type="javax.sql.DataSource"></ResourceLink>

Of course name and global can differ, but I think this is easiest.

There's some hint in the Tomcat 5 docu that this is needed to make global JNDI resources visible to web apps. But it's too easy to forget...

Cheers,
Michael

Mauro Romano Trajber wrote:
I have configured the following datasource in
$TOMCAT_HOME/conf/Catalina/localhost/myapp.xml:

<Context ...>
<Resource name="jdbc/myapp" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/myapp">
<parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
<parameter><name>driverClassName</name><value>com.mysql.jdbc.Driver</value></parameter>
<parameter><name>url</name><value>jdbc:mysql://localhost/myappt</value></parameter>
...
</ResourceParams>
</Context>

Then in my web.xml:
...
<resource-ref>
<res-ref-name>jdbc/myapp</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
...

I'm trying to use Hibernate throung Hibernate Synchronizer Eclipse
Plugin, using JNDI. But I keep getting the error:

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

What's missing ?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to