File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Oracle Drivers under Tomcat 5.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Oracle Drivers under Tomcat 5.5" Watch "Oracle Drivers under Tomcat 5.5" New topic
Author

Oracle Drivers under Tomcat 5.5

Jim Cross
Greenhorn

Joined: Nov 20, 2003
Posts: 17
Hi guys,

I'm experiencing a problem connecting to Oracle 9 from Tomcat 5.5. Have found loads of posts on the net describing the problem, but none of the solutions work for me.

The exception I get is:
Cannot create JDBC driver of class '' for connect URL 'null'
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:243)

Having run this through the debugger in Tomcat, it's definitely a problem loading the class - when I step into DriverManager.loadInitialDrivers(), I can see that drivers in the following snippet is always null:



I've put ojdbc14.jar under common/lib. I have the following in server.xml:



And in web.xml:



I know the classname is correct, as I have a standalone project which loads the driver and connects to the database fine - the problem only occurs under Tomcat.

I'm really tearing my hair out with this one, so any help greatly appreciated!

Cheers,

Jim
Jim Cross
Greenhorn

Joined: Nov 20, 2003
Posts: 17
After a bit more investigation, it's definitely not a driver loading issue, as I can query the db from a Servlet in the same instance by explicitly loading the driver using
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Sirish Kumar Gongal Reddy
Ranch Hand

Joined: Oct 25, 2004
Posts: 109
Jim,

Have you copied classes111.jar or classes12.jar to tomcat/common/lib?

Problem is tomcat is not able to find OracleDriver class which will come along with classes111/12.jar.

Move your .jar file to tomcat lib. It will work.

-Sirish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Oracle Drivers under Tomcat 5.5