Web app running on Tomcat unable to find JDBC driver

I'm running a Web application on Tomcat that is using the P6SPY JDBC driver.  The driver is not being found by app generating the error messages shown below.  I inherited this application from a developer who left.  There is no JDBC configuration info in the web.xml file.  There is info in the repository_database.xml file that configures the  driver but that is all I can find.  Any suggestions as to a solution?
at org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl.checkOutJdbcConnection(Unknown Source)
      at org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.lookupConnection(Unknown Source)
      at org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection(Unknown Source)
      ... 41 more
Caused by: org.apache.ojb.broker.accesslayer.LookupException: Error getting Connection from DriverManager with url (jdbc:oracle:thin:@eos.nih.gov:6202:nidbtst) and driver (com.p6spy.engine.spy.P6SpyDriver)
      at org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.newConnectionFromDriverManager(Unknown Source)
      at org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl$ConPoolFactory.makeObject(Unknown Source)
      at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
      ... 44 more
Caused by: java.sql.SQLException: No suitable driver
      at java.sql.DriverManager.getConnection(DriverManager.java:545)
      at java.sql.DriverManager.getConnection(DriverManager.java:140)
      ... 47 more
org.apache.ojb.broker.PersistenceBrokerException: Used ConnectionManager instance could not obtain a connection
      at org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStatement(Unknown Source)
      at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown Source)
      at org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(Unknown Source)
      at org.apache.ojb.broker.accesslayer.RsIterator.<init>(Unknown Source)
      at org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unknown Source)
      at org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(Unknown Source)
      at org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(Unknown Source)
      at org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(Unknown Source)
      at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unknown Source)
      at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unknown Source)
      at gov.nih.nidb.util.OJB.populateScientist(OJB.java:91)
Who is Participating?
1) do keep oracle jdbc driver and p6spy jdbc driver in classpath OR in WEB-INF/lib.
2) Make sure the spy.properties file is in classpath.
3) make sure the realdriver property in spy.properties contains the reference to the oracle thin driver.
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
just try putting that  P6SPY JDBC driver jar in WEB-INF/lib folder and try again.

If you are using eclipse just add the jar entry to build path (add external jar option).

Thank You.
jwright9Author Commented:
My p6spy driver:


and my Oracle driver:


are in my WEB-INF/lib directory.  I'm using Eclipse but I'm not sure how to add the spy.properties file to the classpath in Eclipse.  The realdriver property:   realdriver=oracle.jdbc.OracleDriver
is present in the spy.properties file.  Both driver jar files are in the .classpath file which I assume is the same as the CLASSPATH.  That is the CLASSPATH is read from the .classpath file.

HOW EVER I AM STILL GETTING THE DRIVER ERROR. (not yelling just want to let you know I still need help!

*grin* Thanks, J.

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

realdriver should be oracle.jdbc.driver.OracleDriver
jwright9Author Commented:
Thanks fargo.  I fixed the real driver line but I'm still getting the error.  I'm running out of ideas.
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
Ok try this out

do a right click on the project and selcet java build path select libraries tab and select and external jars and add all the jars present in the folder in which you found classes12.zip or classes12.jar (jdbc/lib i think) and then try.

And one more thing are you sure that URL which you are using to data base is correct????

is the port number correct Please check this one.

I think the port may be 1521 just check.

And also chek if the entry of the database is there in TNSNAMES file.


Check out may help.

Thank You.

does the exceptions get reduced by adding realdriver. Or the exceptions are still the same as before?
jwright9Author Commented:
Fargo,  The exceptions are about the same.  Thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.