commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Atif Faridi <>
Subject Re: [DBCP] - ClassNotFoundException with Oracle
Date Mon, 25 Jul 2005 15:54:05 GMT
Perhaps my unsophisticated solution will save someone else the 3-hours
it cost me to come up with it.

I was also getting the infamous

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

while programming in Tomcat using DBCP via Spring.

I unsuccessfully tried a number of posted solutions including adding to my classpath and including the Oracle JDBC driver
in WEB-INF/lib/.

In a fit of desperation found that unzipping the archive
and then "jarring" the archive contents fixed my problem. That is,

[~/tmp/oracle/jdbc]: ls -F*
[~/tmp/oracle/jdbc]: unzip
   creating: oracle/
   creating: oracle/sql/
 extracting: oracle/sql/ARRAY.class
[~/tmp/oracle/jdbc]: ls -F*  javax/  oracle/
[~/tmp/oracle/jdbc]: jar cvf oracle-jdbc.jar javax/ oracle/
added manifest
adding: javax/(in = 0) (out= 0)(stored 0%)
adding: javax/sql/(in = 0) (out= 0)(stored 0%)
adding: javax/sql/ConnectionEvent.class(in = 546) (out= 317)(deflated 41%)
[~/tmp/oracle/jdbc]: rm ~/dev/eof-ws/lib/
[~/tmp/oracle/jdbc]: cp oracle-jdbc.jar ~/dev/eof-ws/lib/

I have not gone deeper into the reason for this goofy solution, but it
definitely worked. I'm guessing it has something to do with the web
app class loader.

Here are the software components describing my environment:

Microsoft Windows XP

Oracle8i Enterprise Edition Release
Oracle JDBC Drivers for 8i

Java jonx:
JDK 5.0 - VM version 1.5.0_03
Apache Tomcat 5.5.9
Spring 1.4.1
Commons DBCP 1.2.1

Hope this helps.

Atif Faridi

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

View raw message