Reason: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver

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

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

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

As long as it exists!

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

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

EDITED

I also reference it from context.xml in the 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"/> 
+4
source share
2 answers

Are you sure it exists inside the webapps / yourapp / WEB-INF / lib folder? He must throw this exception if it cannot be seen in this particular directory.

How do you deploy eclipse? Are you exporting a WAR file and deploying it? Make sure your WAR file contains ojdbc14.jar at the specified location.

+8
source

Please make sure that the jug goes to tomcat or tamcat receives a link to the bank. You can do this in the following ways. 1), as mentioned in Adarsh, put the jar file in the WEB-INF / lib folder. 2) in the run-configuration of your tomcat, click ClassPath, and then click User Entity, and then click add jar, where you can select a jar and add it.

0
source

Source: https://habr.com/ru/post/1340613/


All Articles