tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boris Unckel <boris.unckel....@gmx.net>
Subject Re: Classloading scenario
Date Tue, 20 Feb 2007 14:02:40 GMT
Hello,

Angel Todorov wrote:
> I have the following scenario: one webapp, which has some jars in its
> private WEB-INF\lib dir, and one common jar which I would like to
> share among several webapps. Hence, I am putting this jar into the
> shared\lib directory of Tomcat. The problem is that this common lib
> references classes which are in jars in the first webapp's WEB\lib
> directory. Therefore, I get NoClassDefFoundErrors when this common jar
> loads and tries to refer classes from the webapp's private lib.
>
> Is it possible to achieve a workaround with tomcat's classloading for
> that custom scenario?
there is no workaround, but a better strategy and best practise:
Put *all* JARs of a webapp into WEB-INF/lib, if there is not
a strong usecase or technical reason to do otherwise (i.E. some JDBC drivers
should be put into common/lib or shared/lib).

Sharing classes causes definitly more problems than it solves.

Regards
Boris


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message