Tomcat 6 not loading jars from WEB-INF/lib Tomcat 6 not loading jars from WEB-INF/lib spring spring

Tomcat 6 not loading jars from WEB-INF/lib


So, I still don't have a reason for why this is happening, but I was finally able to get it working. Normally, we use 'unzip' to unpack the war into the deploy directory. I switched it to use 'jar' and everything magically works.

I have no idea why this would be. I tried every other permutation (checking our deployment folder, symlinks, permissions, ownerships, etc), and this was the only thing that made a difference, even diffing the two unpacked folders showed they were the same, with the same permissions, but one worked and one didn't

Also of note: the production deploys have been using 'unzip' for years. I really can't figure this one out, but I'm glad I can at least work on something else.


One thing to look into, the ClassNotFoundException does not always mean the listed class (in your case org.springframework.web.context.ContextLoaderListener) was not found, it could mean that class could not be loaded.

If that particular class fails to load for any reason, say it has a static block that references another class that isn't found, the class loader reports failure to load as "ClassNotFoundException".

Make sure that your WEB-INF/lib directory does not contain classes/jars that also exist in the Tomcat default libraries. This can sometimes cause the load failures if there are multiple versions. By unzipping the jars into the classes directory you may be moving classes in the path order which is why it could be working.