tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Kirk" <tomcat-u...@web-startup.co.uk>
Subject DBCP datasource works on 5.0.28 but fails on 5.5.9
Date Fri, 20 May 2005 15:12:27 GMT

I know that DBCP is a common problem discussed on this list - I have been
helped, and have helped other people, with it before. So before posting this
message, I have recently re-read the 5.5 release notes and 5.0/5.5 DBCP/JNDI
how-to docs and checked the list archives.  But can't find a solution to my
current problem.

Until recently I had a working webapp running on tomcat 5.0.28 with
connector/j 3.1.7 and mysql 4.1.11-nt, all on windows XP and jdk1.4.2_08.
The app uses container-managed commons DBCP for all its database access.

The DBCP resource config has been set up and working unchanged for a long
time on various builds of TC 5.0.  I have it set up like this:

<ResourceParams> defined in context.xml, in war file's META-INF folder
<resource-ref> declared in web.xml in war file's WEB-INF folder
The connector/j jar file is in tomcat's /common/lib folder
name of JNDI resource matches in <ResourceParams>, <resource-ref> and Java
source code.

This all works on TC5.0.28 / JDK1.4.2_08.  However, I am attempting to
upgrade to TC 5.5.9 / JDK1.5.0_02.  I did a fresh install of both of these
to standard directories, recompiled the webapp for jdk1.5, and deployed it
with the same config files and setup above from TC 5.0.28. However the
webapp now reports an error when requesting a connection from the pool, see
stacktrace below (from the TC stdout logfile under TC logs directory).

I tried changing my context.xml so that the params are all pairs of
name="value" within a single <Resource/> tag, as now seems to be preferred
in the 5.5 DBCP how-to, rather than my original nested set of tags under
<ResourceParams>, which was the approach used in the 5.0 equivalent how-to.
But still no joy.

I also tried upgrading to connector/j 3.1.8, no joy there either.

When TC starts up, the webapp deploys OK from its war file, and the
context.xml is copied to the /conf/[engine]/[host]/ folder OK, without any
parsing errors logged.  The connection pool initially seems to work, in the
sense that this code executes OK: 
	Context ctx = new InitialContext();
	String resourceString = "java:comp/env/jdbc/" +
config.getString(ConfigConstants.JNDI_DATABASE_RESOURCE_NAME);
	DataSource pool = (DataSource)ctx.lookup(resourceString);

However, an Exception is thrown the first time that I do this: 
	Connection conn = pool.getConnection();

I'm stumped after hours working on this.  I've read through all the docs,
how-tos, and release notes that I can find, and searched the mail list
archives on mysql and tomcat sites, as well as googling various searches.
Has anyone had this problem themselves or have any insight to offer please?

Thanks,

Steve.
-----------------------------------------------------------------
Exception caught when establishing/testing database pool****
cause[0]: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'
 at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:780)
 at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)
 at core.sql.SqlQuery.prepare(SqlQuery.java:80)
 at core.sql.SqlQuery.executeSingleValue(SqlQuery.java:133)
 at core.servlet.Invoker.setUpDataSource(Invoker.java:325)
 at core.servlet.Invoker.init(Invoker.java:129)
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
91)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:925)
 at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3857)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4118)
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7
59)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
 at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:589)
 at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:536
)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:471)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)
 at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:119)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
 at org.apache.catalina.core.StandardService.start(StandardService.java:450)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
 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:585)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
cause[1]: java.sql.SQLException: No suitable driver
 at java.sql.DriverManager.getDriver(DriverManager.java:243)
 at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:773)
 at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)
 at core.sql.SqlQuery.prepare(SqlQuery.java:80)
 at core.sql.SqlQuery.executeSingleValue(SqlQuery.java:133)
 at core.servlet.Invoker.setUpDataSource(Invoker.java:325)
 at core.servlet.Invoker.init(Invoker.java:129)
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
91)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:925)
 at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3857)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4118)
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7
59)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
 at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:589)
 at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:536
)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:471)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)
 at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:119)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
 at org.apache.catalina.core.StandardService.start(StandardService.java:450)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
 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:585)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)



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