I experienced the same problem when I ported my application to 4.1.12. 
In my case the exception was about the null url. It is evident from the 
exception that the jdbc driver class is not loaded as it was set to null.

Try changing the sequence of the parameter in the datasource 
defincation. Put your driver class parameter just after the factory and 
username and password at the end.

Have a look on your classes.jar. Does the file have read permissions?

Raj Saini


This may be one cause,
Robert Herold wrote:
> Thanks for the suggestion.  I just tried the example JDBC configuration from
> the JNDI-howto, and unfortunately it still gets the same error.  I am using
> tomcat standalone.
> 
> Weird.  Guess I'll stick with tomcat 4.0.x for now...
> 
> -- bob
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> g]On Behalf Of Jake Tweer
> Sent: Tuesday, October 01, 2002 8:11 PM
> To: Tomcat Users List
> Subject: Re: tomcat 4.1.12 JDBC driver class 'null'
> 
> 
> I'm getting the same error with MySQL and I've seen posts for
> PostgreSQL, MySQL and Oracle.  I have followed all suggestions with no
> luck except for one case - the example given in the JNDI - How To works
> for me.  The example is using standalone Tomcat and that works.  As soon
> as I use Apache/mod_webapp I get the exception Cannot load JDBC driver
> class 'null'.
> 
> 
> 
> Robert Herold wrote:
> 
> 
>>I've been happily using tomcat 4.0.4 for a while, and thought I'd upgrade
> 
> to
> 
>>version 4.1.12.  Alas, I cannot get tomcat to find my Oracle JDBC driver
>>when I use 4.1.12.  It worked fine in 4.0.4.
>>
>>Any ideas what might be wrong?
>>
>>My classes12.jar is in common/lib where it is supposed to be.  It's the
> 
> same
> 
>>file as I used under tomcat 4.0.4, so it is known to be good.
>>
>>I followed the configuration steps for setting up the JNDI Datasource very
>>carefully.
>>
>>The exception I get is:
>>
>>Caused by: java.sql.SQLException: Cannot load JDBC driver class 'null'
>>      at
>>
> 
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav
> 
>>a:529)
>>      at
>>
> 
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3
> 
>>12)
>>      at com.cotagesoft.common.XDataSource.getConnection(XDataSource.java:107)
>>      ... 31 more
>>
>>My resource definition in server.xml is:
>>
>>     <DefaultContext debug="0" reloadable="true">
>>       <Resource name="jdbc/CotagesoftDB" auth="Container"
>>                  type="javax.sql.DataSource"/>
>>        <ResourceParams name="jdbc/CotagesoftDB">
>>         <parameter>
>>           <name>factory</name>
>>           <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>>         </parameter>
>>         <parameter>
>>           <name>username</name>
>>           <value>fred</value>
>>         </parameter>
>>         <parameter>
>>           <name>password</name>
>>           <value>fred</value>
>>         </parameter>
>>         <parameter>
>>           <name>driverClassName</name>
>>           <value>oracle.jdbc.driver.OracleDriver</value>
>>         </parameter>
>>         <parameter>
>>           <name>driverName</name>
>>           <value>jdbc:oracle:thin:@localhost:1521:ctg</value>
>>         </parameter>
>>         <parameter>
>>           <name>maxActive</name>
>>           <value>20</value>
>>         </parameter>
>>         <parameter>
>>           <name>maxIdle</name>
>>           <value>10</value>
>>         </parameter>
>>         <parameter>
>>           <name>maxWait</name>
>>           <value>-1</value>
>>         </parameter>
>>       </ResourceParams>
>>      </DefaultContext>
>>
>>And it is referenced in web.xml with:
>>
>>  <resource-ref>
>>
>>    <description>
>>      Resource reference to a factory for java.sql.Connection
>>      instances that may be used for talking to a particular
>>      database that is configured in the server.xml file.
>>    </description>
>>
>>    <res-ref-name>jdbc/CotagesoftDB</res-ref-name>
>>    <res-type>javax.sql.DataSource</res-type>
>>    <res-auth>Container</res-auth>
>>
>>  </resource-ref>
>>
>>Any ideas on what to try would be appreciated.  Thanks.
>>
>>-- bob
>>
>>----------
>>Robert Herold
>>Cotagesoft, Inc.
>>650 474 9013 x808
>>
>>
>>
>>--
>>To unsubscribe, e-mail:
> 
> <mailto:[EMAIL PROTECTED]>
> 
>>For additional commands, e-mail:
> 
> <mailto:[EMAIL PROTECTED]>
> 
>>
>>
> 
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 




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

Reply via email to