This is likely related to the issue in the following threads:

"ResourceLink and DefaultContext"
"Globally defined JNDI DataSource (was: JNDI DataSource Realm)"

Only difference being that yours is JDBC and these others are JDBC through
JNDI.  You get the "driver class 'null'" error, we get the "jdbc not defined
in this context" error.

I bet they're related.  Someone should report as a bug or post to dev list I
guess?

-----Original Message-----
From: Peter Harrison [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 20, 2003 8:13 PM
To: 'Tomcat Users List'
Subject: Tomcat 4.1 DefaultContext Bug?


I have spent the last three days trying everything to move from 4.0 to 4.1. 
The problem is with the datasources. When the resource is in a specific 
Context everything works, but when its in the DefaultContext I am getting a

java.sql.SQLException: Cannot load JDBC driver class 'null'

The server.xml has a resource defined:

<Resource name="jdbc/foo" auth="Container" type="javax.sql.DataSource"/>

<ResourceParams name="jdbc/foo">
        
<parameter><name>user</name><value>foo</value></parameter>
        
<parameter><name>password</name><value>bar</value></parameter>
                        <parameter><name>driverClassName</name>
        
<value>org.postgresql.Driver</value></parameter>
                        <parameter><name>url</name>
        
<value>jdbc:postgresql://localhost/foo</value></parameter>
</ResourceParams>

My web.xml now has:

 <resource-ref>
      <description>Foo Database</description>
      <res-ref-name>jdbc/foo</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>


The driver is there - since I it works when the Context is specific. The 
problem however is that a Context that is specified will block unpacking of
a 
war. There are some issues with using the war directly without unpacking -
so 
I need to define the datasource in the DefaultContext. However this isn't 
working.

Simply changing from DefaultContext to Context "solves" the problem -
proving 
that it is the DefaultContext which doesn't appear to work.

Help :)

Peter

---------------------------------------------------------------------
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