1
votes

I have a big application using a lot of jars, mostly are common jars between other apps (also mine), so, I want to create a shared repository.

I have edited the catalina.properties (Tomcat 7) this way:

shared.loader=${catalina.base}/mylibs/*.jar

If I put all my project's jars inside that directory all goes well and the application runs normally, but I don't want that, I just want to put the shared libs there and leave the rest of jars normally inside my WAR (WEB_INF/lib)..

If I go this way (some jars in shared lib and the rest on the war file) my application start to raise ClassNotFoundException with every jar inside the war.

According to: http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html it should work fine, as they say:

Therefore, from the perspective of a web application, class or resource loading looks in the following repositories, in this order:

Bootstrap classes of your JVM System class loader classes (described above) /WEB-INF/classes of your web application /WEB-INF/lib/*.jar of your web application Common class loader classes (described above)

Anyone knows what I'm doing wrong? Cheers

1

1 Answers

1
votes

this was a simple mistake.

I accidentally leave an app jar into the shared class loader, so, that jar was trying to access a class on my webapp1 class loader but he can't invoke every class loader since he only knows his father (they can't look down).

Cheers,