tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charlotte Binns" <Charlotte.Bi...@tate.org.uk>
Subject Cannot create JDBC driver of class error occurs when upgrading from tomcat-6.0.33 to tomcat 6.0.35
Date Mon, 12 Dec 2011 14:40:09 GMT
Hi,
 
I wonder if any one can offer me any assistance with a problem I am
having as I am struggling to find the resolution to my issue. I am
attempting to upgrade my tomcat version from tomcat 6.0.33 to tomcat
6.0.35.
 
My server build is:
Centos 5.5 32 bit
Apache web server 2.2.21
PHP 5.3.8
mysql 5.5.15
 
tomcat 6.0.35 
 
The problem is I keep getting a database exception for mysql databases
only. My oracle databases still work.
 
This is the error I get:
 
Cannot create JDBC driver of class '' for connect URL
'jdbc:mysql://hostname/dbname'
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:279)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(Basi
cDataSource.java:1437)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSo
urce.java:1371)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourc
e.java:1044)
at
org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.get
Connection(LocalDataSourceConnectionProvider.java:82)
at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.ja
va:423)
at
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.jav
a:144)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
at
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
at
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
at
uk.org.tate.roblib.hibernate.sequence.StandaloneHibernateSequenceGenerat
or.init(StandaloneHibernateSequenceGenerator.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414
)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec
t(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
etSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:164)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.re
solveReference(BeanDefinitionValueResolver.java:269)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.re
solveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec
t(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
etSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:164)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.re
solveReference(BeanDefinitionValueResolver.java:269)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.re
solveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec
t(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
etSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:164)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.re
solveReference(BeanDefinitionValueResolver.java:269)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.re
solveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec
t(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
etSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:164)
at
org.springframework.context.support.AbstractApplicationContext.getBean(A
bstractApplicationContext.java:880)
at
uk.org.ponder.springutil.BeanFactoryBeanLocator.locateBean(BeanFactoryBe
anLocator.java:26)
at
uk.org.ponder.springutil.TLABPostProcessor.fetchValue(TLABPostProcessor.
java:123)
at
uk.org.ponder.springutil.TLABPostProcessor.postProcessBeforeInitializati
on(TLABPostProcessor.java:180)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapable
BeanFactory.java:350)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec
t(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
etSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.pre
InstantiateSingletons(DefaultListableBeanFactory.java:429)
at
org.springframework.context.support.AbstractApplicationContext.finishBea
nFactoryInitialization(AbstractApplicationContext.java:728)
at
org.springframework.context.support.AbstractApplicationContext.refresh(A
bstractApplicationContext.java:380)
at
org.springframework.web.context.ContextLoader.createWebApplicationContex
t(ContextLoader.java:255)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(
ContextLoader.java:199)
at
uk.org.ponder.rsf.servlet.ReasonableSpringServlet.init(ReasonableSpringS
ervlet.java:43)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
a:1206)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
ava:4421)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4734
)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja
va:799)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:
675)
at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java
:601)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:32
4)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at
org.apache.catalina.core.StandardService.start(StandardService.java:525)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Cannot create JDBC driver of class '' for connect URL
'jdbc:mysql://tatesql/mygallery'
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:279)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(Basi
cDataSource.java:1437)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSo
urce.java:1371)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourc
e.java:1044)
at
com.googlecode.psiprobe.controllers.sql.ConnectionTestController.handleC
ontext(ConnectionTestController.java:52)
at
com.googlecode.psiprobe.controllers.ContextHandlerController.handleReque
stInternal
 
This is my resource configuration in server.xml
 
         <Resource
                name="jdbc/dbname1"
                auth="Container"
                type="javax.sql.DataSource"
                DriverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://hostname/dbname1"
                username="username"
                password="password"
                maxActive="10"
                maxIdle="5"
                minIdle="1"
                maxWait="15000" />
 
         <Resource
                name="jdbc/dbname2"
                auth="Container"
                type="javax.sql.DataSource"
                DriverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://hostname/dbname2"
                username="username1"
                password="password1"
                maxActive="10"
                maxIdle="5"
                minIdle="1"
                maxWait="15000" />
 
Everything works fine in tomcat 6.0.33. I have tried updating the mysql
connectro but this has made no difference.
 
The connector I am using in 6.0.33 is: mysql-connector-java-5.1.14.jar I
tried using this with 6.0.35 also. When I got the error I tried
mysql-connector-java-5.1.18-bin.jar but this did not work so I have
rolled back to mysql-connector-java-5.1.14.jar. 
 
I have been through the upgrade procedure previously when we upgraded
form tomcat 6.0.32 to tomcat 6.0.33 which went very smoothly.
 
I am currenlty performing the upgrade in  my development environment but
will soon need to roll out to my production environment.
 
I do not believe it is a bug but maybe I am missing something in my
upgrade procedures. I basically downloaded the
apache-tomcat-6.0.35.tar.gz file.
 
I added all my configuration to server.xml/web.xml and tomcat-users.xml
then copied in my web applications and /tomcat/conf/Catalina/localhost
xml files required for my web applications.
 
Is there any help/tips/advise that you can give at all for me to resolve
this issue please? 

Please let me know if you need any further information to the issue,
 
Thank you

Charlotte Binns 
IS Technical Architect
(020) 7887 8622 

 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message