tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Schildbach <andr...@schildbach.de>
Subject org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause: java.sql.SQLException: No suitable driver
Date Wed, 11 Feb 2004 17:10:25 GMT
I get this error using Tomcat 5.0.18 under Debian/Linux. Using the same 
configuration under Windows XP, there is no problem. Using the same 
application under Tomcat 4.1.27, there is no problem (either Linux or 
Windows).

As you can see from the included stack trace, I am using Hibernate which 
is accessing the configured DataSource in a Servlet Filter at 
application startup.

I have searched for this problem on this Mailing List, but got no clue. 
I am using a Context local DataSource (no Global), and have everything 
strictly setup as described in the JNDI HowTo. Given the number of 
people that could not solve the problem, maybe there is a bug in Tomcat5?

Regards,

Andreas

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
class '' for connect URL 'null', cause:
java.sql.SQLException: No suitable driver
         at java.sql.DriverManager.getDriver(DriverManager.java:243)
         at 
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743)
         at 
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
         at 
net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)
         at 
net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
         at 
net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1119)
         at 
net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:748)
         at 
de.schildbach.integration.HibernatePersistance.init(HibernatePersistance.java:41)
         at 
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:272)
         at 
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:355)
         at 
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:126)
         at 
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3646)
         at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4275)
         at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
         at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
         at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)
         at 
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:320)
         at 
org.apache.catalina.core.StandardHost.install(StandardHost.java:875)
         at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:727)
         at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:477)
         at 
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1008)
         at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:394)
         at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
         at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
         at 
org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
         at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
         at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518)
         at 
org.apache.catalina.core.StandardService.start(StandardService.java:519)
         at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:2345)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:598)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)

My server.xml:

                                 <Context path="" docBase="schildbach" 
reloadable="false">

                                         <Resource name="jdbc/xxx" 
auth="Container" type="javax.sql.DataSource"/>
                                         <ResourceParams 
name="jdbc/schildbach">
 
<parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
 
<parameter><name>maxActive</name><value>5</value></parameter>
 
<parameter><name>maxIdle</name><value>0</value></parameter>
 
<parameter><name>maxWait</name><value>10000</value></parameter>
 
<parameter><name>username</name><value>xxx</value></parameter>
 
<parameter><name>password</name><value>xxx</value></parameter>
 
<parameter><name>driverClassName</name><value>com.mysql.jdbc.Driver</value></parameter>
 
<parameter><name>url</name><value>jdbc:mysql://localhost/xxx?autoReconnect=true&amp;relaxAutoCommit=true</value></parameter>
                                         </ResourceParams>

                                 </Context>

My web.xml:

         <resource-ref>
                 <res-ref-name>jdbc/xxx</res-ref-name>
                 <res-type>javax.sql.DataSource</res-type>
                 <res-auth>Container</res-auth>
         </resource-ref>


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


Mime
View raw message