2

My Java project when I run it on local server (localhost:8080) is throwing an error: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver

This error is thrown when Hibernate is trying to connect to Oracle database on

 session = PersistenceManager.sessionFactory().openSession();

When I deploy app to Production or Test server there is no problem. In order to troubleshoot I need to make it work on my local machine. What am I missing?

First I thought that Oracle drivers are missing so I downloaded classes12.jar and added it to Java Build Path > Libraries. That didn't help. I am still getting same error.

Thanks

1
  • The Java Build path is the classpath used to compile your Java code. It's not the same thing as the classpath used to run the deployed application. If it's a web app, the jar should be in the appserver classpath, or in the war's WEB-INF/lib directory. Commented Aug 29, 2011 at 19:49

2 Answers 2

2

ojdbc6.jar is the jar for the oracle jdbc driver - make sure it's on the classpath

Sign up to request clarification or add additional context in comments.

Comments

1

It might be on your build path but is it on the classpath of your app server ?

1 Comment

Thanks. It was not. I copied ojdbc14.jar from lib folder from Test server to lib folder on my local machine and everything works now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.