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"/>
Dejell
  • 13,947
  • 40
  • 146
  • 229

2 Answers2

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.

adarshr
  • 61,315
  • 23
  • 138
  • 167
  • Yes. It's out of eclipse. I exported the war file and deploy it on Tomcat. it has ojdbc14.jar under web-inf lib – Dejell Feb 21 '11 at 12:55
  • 3
    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. – adarshr Feb 21 '11 at 12:57
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.

Ranger
  • 435
  • 1
  • 4
  • 19
  • Run configuration of tomcat out of Eclipse ? – Dejell Feb 21 '11 at 12:55
  • 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 – Ranger Feb 21 '11 at 18:53