tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jake Tweer <ja...@pyramidx.com>
Subject Re: tomcat 4.1.12 JDBC driver class 'null'
Date Wed, 02 Oct 2002 03:10:44 GMT
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:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message