Java – Tomcat 6 does not load jars from WEB-INF / lib
I'm trying to track configuration issues in my Tomcat environment Our production server is running a Tomcat installation and reading data from a shared NFS installation
However, when I try the same war with separate boxes (using their configuration), I receive the following error
Interestingly, if I unzip all the jars in WEB-INF / lib into WEB-INF / classes, this error will disappear
So, it seems that something prevents the application from loading the WEB-INF / lib path, but I can't find any Tomcat settings for my life that will cause this, because it is detecting the application and configuration, but it doesn't include the jar
Any ideas?
Solution
It should be noted that classnotfoundexception does not always mean that the listed class cannot be found (org.springframework.web.context.contextloaderlistener in your case), it may mean that the class cannot be loaded
If the specific class cannot be loaded for any reason, such as it has a static block that references another class that was not found, the class loader reports that it cannot be loaded as "classnotfoundexception"
Make sure that your WEB-INF / lib directory does not contain the classes / jars that also exist in the Tomcat default library If there are multiple versions, this sometimes leads to loading failure By extracting the jar into the classes directory, you may move the classes in path order, which is why it works