6

I created a web application with ojdbc14.jar in lib folder.

However, when I start my tomcat I get an error:

Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver

While it exists there!

When I deploy the same application to my local tomcat in Eclipse it works fine.

However when I deploy it out of Eclipse I get this message, although the jar exists!

EDITED

I refer to it also from the context.xml under META-INF folder:

<WatchedResource>WEB-INF/web.xml</WatchedResource>
     <Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory" />
     <Resource name="jdbc/testDS1" auth="Container" type="javax.sql.DataSource"
               maxActive="15" maxIdle="2" maxWait="10000"
               logAbandoned="true"
               username="cust" password="cust"
               driverClassName="oracle.jdbc.OracleDriver"
               url="jdbc:oracle:thin:@myserver:id:name"/>
1
  • 1
    are you referring it from any of the XML files ? Commented Feb 21, 2011 at 12:39

2 Answers 2

9

Are you sure it exists inside webapps/yourapp/WEB-INF/lib folder? It is bound to throw that exception if it can't be seen in that specific directory.

How do you deploy out of eclipse? Do you export a WAR file and deploy? Verify that your WAR file contains ojdbc14.jar in the specified location.

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

2 Comments

Yes. It's out of eclipse. I exported the war file and deploy it on Tomcat. it has ojdbc14.jar under web-inf lib
Do you have an ojdbc.jar in a parent location such as $CATALINA_HOME/lib or $CATALINA_HOME/lib/ext? If so, try by removing the jar file from one of the locations. It often leads to class loading conflicts in such cases.
0

Please make sure that the jar goes to the tomcat or tamcat gets the reference to the jar. you can do it following ways. 1) as mentioned by Adarsh, put the jar file in WEB-INF/lib folder. 2) in the run-configuration of your tomcat, click on ClassPath and then click on User Entity and then click on add jar where u can select the jar and add it.

2 Comments

Run configuration of tomcat out of Eclipse ?
in java perspective, to start the tom cat you have Run in the menu there you will have a option called run configuration in that you can select the configuration to run tomcat

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.