tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Mikusa <dmik...@gopivotal.com>
Subject Re: Reg: Connection pool
Date Mon, 07 Oct 2013 10:47:37 GMT
On Oct 7, 2013, at 1:00 AM, Anu Prab <anuprab2@gmail.com> wrote:

> Hi,
> 
> 
> The Tomcat version I am using is 7.0.40 and the connection pool is
> tomcat-jdbc. I am having trouble configuring the connection pool. The
> configuration does not trouble as long as I do not include initialSize and
> factory attributes. But when I include any of these two, Tomcat starts
> throwing the below exception:
> 
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver
> class 'oracle.jdbc.OracleDriver'
>        at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429)
>        at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
>        at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getLogWriter(BasicDataSource.java:1098)
>        at
> org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:350)
>        at
> org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory.getObjectInstance(BasicDataSourceFactory.java:156)
>        at
> org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:143)
>        at
> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
>        at
> org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1093)
>        at
> org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:672)
>        at
> org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:271)
>        at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>        at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>        at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
>        at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>        at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
>        at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
>        at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
>        at
> org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
>        at
> org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)
>        at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>        at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>        at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>        at java.lang.Thread.run(Thread.java:722)
> Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
>        at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
>        at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
>        at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)
> 
> 
> Why is this happening

It's happening because you're trying to use a JDBC driver that cannot be loaded.  Where do
you have your Oracle driver?  It should be in CATALINA_BASE/lib or CATALINA_HOME/lib.

> ClassNotFoundException: oracle.jdbc.OracleDriver

> and why this happens specifically when I include these two attributes?

By default the pool is not going to make any connections to the database when it is created.
 Because it doesn't make any connections, it doesn't need the driver.  If you set "initialSize"
to something greater than 0, it will create connections at start up and thus it will need
the driver class.

Dan

> Any help is appreciated. Thanks.
> 
> 
> -Anu


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


Mime
View raw message