• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Oracle Drivers under Tomcat 5.5

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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());
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic