[Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2101
  • Last Modified:

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)
  • 3
  • 3
  • 2
1 Solution
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.
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.
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.

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now