This Java web-app I am using that other developers wrote is structured in the standard way. However, .class files are not located under WEB-INF/classes they are instead grouped together in a .jar and stored under WEB-INF/lib/myapp.jar.
The issue is that I can’t find where the program tells Tomcat to load myapp.jar for the class files. The app is working fine, but how does it know to load that myapp.jar?
I’ve tried grepping my way through pretty much all conf files (in Tomcat and inside the app), and nowhere I can reference this myapp.jar file.
Following from what @nhnb said, here‘s an explanation from Apache on how Tomcat’s classLoader works.
So if you want to reference
myApp.jaryou must be under the same class loader of that webapp, which essentially means that you have to be in the same webapp.Alternatively, load your jar in
TOMCAT_HOME/lib(Tomcat 6 and higher) orTOMCAT_HOME/common/lib. All jars found there are visible to all class loaders.