tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Crowther" <>
Subject RE: Different jar version
Date Wed, 10 Oct 2007 14:51:22 GMT
> From: Andrew Hole [] 
> What happens if I put different jar versions of same classes 
> on WEB-INF/lib?
> Example:
> project.jar (new version)
> project_old.jar (old version)
> Tomcat load and use both? Could Tomcat be confused with this 
> situation?

Each time a class is requested, the classloader looks through the jars
until it finds a class with that name, then immediately loads the one it
finds.  There may be other copies in other jars; they are not loaded.

To my knowledge*, there's no way of knowing in advance in which order
Tomcat will look through the jars.  If you have two classes with the
same name, you have no way of knowing in advance which one will be
loaded.  Tomcat won't be confused, but you sure will be if you have
different versions of the same classes in different jars :-).

		- Peter

* As always, happy to be corrected by those who know better!

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message