I have a legacy web app running in Tomcat 5.0.
This web app has two jars in WEB-INF/lib, let\'s say Foo-2.0.jar and Bar-2.0.jar
Tomcat 5's classloading precedence for webapps is roughly as follows: first the bootstrap/system (JRE/lib
, then Tomcat's internal classes), then the webapp libraries (first WEB-INF/classes
, then WEB-INF/lib
), then the common libraries (first Tomcat/common
, then Tomcat/lib
) and finally the webapp-shared libraries (Tomcat/shared
).
So to get Foo-2.0.jar
loaded before Bar-2.0.jar
, best what you can do is to move Bar-2.0.jar
from WEB-INF/lib
to Tomcat/common
or Tomcat/shared
.
The JAR's aren't loaded in alphabetic order of their name. At least, there's no spec which says that. Renaming them to change the alphabetical filename order makes no sense.