> Hi There,
>
> We are about to upgrade from tomcat-7.0.65 to tomcat-8.0.XX. and this is
> regarding the loading of same JARs within the different application. to
> understand the scenario, consider below case
>
> Tomcat 8 ---
>         webapps
>             a.war--> lib--> spring.jar
>             b.war--> lib--> spring.jar
>
> here b.war is just a copy of a.war and renamed just to differentiate hence
> spring.jar is same for both the applications.
>
> My question is
>
> 1) will spring.jar loaded twice

yes it will be loaded twice

> 2) how to i make sure to load it only once ( if loaded twice)

This question comes up frequently. Search the mailing list for shared
class loader to see the details. The upshot is that this can be done
using shared class loader, however there are real technical issues if
you do this - class cast exceptions, difficulty performing upgrades to
individual wars without taking down all of tomcat. The only positive
is that you might save a few MB of memory cost by having the same jar
loaded twice in memory.

I've been on this mailing list for ~8 years, and every time this
issues comes up (about 5 times a year?), the tomcat developers suggest
that the proposed memory saving isn't not worth the problems that it
causes..

HTH

Chris

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

Reply via email to