I have put my jar files in folder named “myLibs” under lib folder of my application. When I run application I get NoClassDefFoundException for the classes which are inside the jars (placed inside myLibs folder). But when I put that inside lib folder I can access it’s classes. So my question is: “Can’t we create a folder inside lib folder of our application in apache tomcat and put over jars there? Why is this not possible?”
My folder structure:-
TOMCAT_HOME
|
+----webapps
|
+---- MyApp
|
+----WEB_INF
|
+----lib
|
+----myLibs
Apache tomcat version:- 6.0.20
You probably need to adjust your
$CLASSPATHto include the pathTOMCAT_HOME/webapps/MyApp/WEB_INF/lib/myLibs. You might specify it inshared.loaderorcommon.loaderproperty of/conf/catalina.properties.