Harry Joy
Harry Joy

Reputation: 59694

Can not access jar file under lib folder in apache tomcat

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

Upvotes: 2

Views: 3156

Answers (2)

Abhimanyu Srivastava
Abhimanyu Srivastava

Reputation: 506

Tomcat takes the default directory as lib......so if you want to hmake your own folder inside the lib then u probably need to redefine the the path..... look here for more details hope it helps....

Upvotes: 1

binfalse
binfalse

Reputation: 518

You probably need to adjust your $CLASSPATH to include the path TOMCAT_HOME/webapps/MyApp/WEB_INF/lib/myLibs. You might specify it in shared.loader or common.loader property of /conf/catalina.properties.

Upvotes: 0

Related Questions