aspose file tools*
The moose likes Servlets and the fly likes ClassNotFound OracleDataSource in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "ClassNotFound OracleDataSource in servlet" Watch "ClassNotFound OracleDataSource in servlet" New topic
Author

ClassNotFound OracleDataSource in servlet

Graeme Byers
Ranch Hand

Joined: Apr 16, 2004
Posts: 127
This may be more appropriate for the Java Beginners forum.

My Environment : Win XP Pro , Apache-Tomcat-6.0.18 , Oracle XE 10.2.0 , JDK 1.6

I'm trying to code my first JDBC servlet (DNameModel) - it compiles but when executed :

C:\apache-tomcat-6.0.18\logs\localhost.txt :
java.lang.ClassNotFoundException: oracle.jdbc.pool.OracleDataSource
at gbpackage.DNameModel.doGet(DNameModel.java:18)

My %CLASSPATH% :
.;
C:\apache-tomcat-6.0.18\lib\servlet-api.jar;
C:\apache-tomcat-6.0.18\lib\jsp-api.jar;
C:\apache-tomcat-6.0.18\lib\el-api.jar;
C:/apache-tomcat-6.0.18/webapps/ROOT/WEB-INF/classes;
C:\apache-tomcat-6.0.18\webapps\GBWebApp\WEB-INF\classes;
C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar;
C:\oraclexe\app\oracle\product\10.2.0\server

I look inside ojdbc14.jar , using WinRar , and find OracleDataSource.class in
ojdbc14.jar\oracle\jdbc\pool - ZIP archive, unpacked size 3,314,281 bytes

My non-JDBC servlets and batch Oracle JDBC programs which use OracleDataSource execute OK .

Thank you for your help.
Graeme.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61230
    
  66

At run-time the classpath means nothing. You'll need to add the driver jar to the web app's WEB-INF/lib folder.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassNotFound OracleDataSource in servlet