tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anu Prab <anupr...@gmail.com>
Subject Re: Reg: Connection pool
Date Mon, 07 Oct 2013 10:52:07 GMT
> 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(Ba

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

Hi,

Yes Dan, you are right. I placed the jar in the correction location now..
Thanks for the help. However, am now facing the below exception.

WARNING: Unexpected exception resolving reference
java.sql.SQLException: invalid arguments in call
        at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
        at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:236)
        at
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
        at
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
        at
org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
        at
org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
        at
org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:702)
        at
org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:634)
        at
org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:488)
        at
org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144)
        at
org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
        at
org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
        at
org.apache.tomcat.jdbc.pool.DataSourceFactory.createDataSource(DataSourceFactory.java:539)
        at
org.apache.tomcat.jdbc.pool.DataSourceFactory.getObjectInstance(DataSourceFactory.java:237)
        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)

This is happening whenever I change the value of initialSize property to
something greater than 0.

-Anu

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