commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <>
Subject Re: [DBCP] - ClassNotFoundException with Oracle
Date Fri, 05 Mar 2004 04:59:07 GMT

DBCP needs access to the oracle driver.  The way classpaths work, the 
parent can't see the child.  As such, library in common/lib, server/lib, or 
shared/lib cannot load a library in WEB-INF/lib.  As such, you will need to 
put the oracle jar in common/lib.  There is no way around it if you want 
the container to manage the connection pool.  If Tomcat used something like 
JBoss' unified classloader, it might be different, but with the classloader 
hierarchy that Tomcat uses, you'll just have to bite the bullet and move 
the oracle driver out of WEB-INF/lib and into common/lib.


At 09:22 AM 3/5/2004 +0530, you wrote:
>Hi all,
>     I am getting ClassNotFoundException when I put the ojdbc14.jar in the
>WEB-INF\lib folder. If I keep it in common\lib it is ok. Using JNDI to get a
>Tomcat 4.1.27
>DBCP 1.1
>JDK 1.4.1
>The line throwing exception is -  ds.getConnection();
>This is the stack trace.
>org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class
>'oracle.jdbc.driver.OracleDriver', cause:
>java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
>  at
>  at
>  at java.lang.ClassLoader.loadClassInternal(
>  at java.lang.Class.forName0(Native Method)
>  at java.lang.Class.forName(
>  at
>  at
>  at util.Pool.getConnection(
>Antony Paul
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message