Thanks for quick response Mark.

JARs in /mylib are not dependent on JARs in web app. In fact its the other way 
round. /mylib is having all Spring, hibernate jar’s, other common libs and 
WEB-INF/lib is containing jar of one of my application modules.
The class for which i am getting ClassNotFoundException exception is part of 
JAR present under WEB-INF/lib.

I enabled the class loader logs and don’t see that class getting loaded on 
server startup. However, when i copy all JAR’s from /mylib to WEB-INF/lib, that 
class is getting loaded and i don’t get the ClassNotFoundException on runtime.

Any thoughts what might be causing this?

Aditya

> On 26-May-2015, at 3:04 pm, Mark Thomas <ma...@apache.org> wrote:
> 
> On 26/05/2015 08:36, Aditya Chopra wrote:
>> Hi,
>> 
>> To reduce the size of my war file, i am trying to put all the jar files 
>> being used by my web app in a separate folder /mylibs. I added path to 
>> /mylibs folder under shared.loader property in catalina.properties but on 
>> runtime i am getting a ClassNotFoundException for one of the classes that is 
>> present in one the project module jar under WEB-INF/lib folder.
>> 
>> When i add all the libraries required by my project in WEB-INF/lib folder my 
>> application works fine. However, when i put the libraries in a separate 
>> /mylibs folder i get a ClassNotFoundException on runtime. 
>> 
>> I suspect that it could be due to order in which the classes are being 
>> loaded, so added a Loader component in my context.xml as below, but that too 
>> didn’t work. Can someone please help me on this?
> 
> JARs in /mylibs must not depend on JARs in a web application. There is
> no configuration option that would enable you to bypass this restriction.
> 
> Mark
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to