tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Loading Jar files in a particular order on Tomcat 6
Date Fri, 09 Oct 2009 21:19:27 GMT
Hash: SHA1


On 10/2/2009 4:30 PM, Rasmus Larsen wrote:
> I've created a custom class loader, which first first tries to load
> classes from a specific set of jars, and if that fails it just loads
> the class in the standard manner. This makes it possible to ensure
> that a specific set of jar files are always used first. This solves my
> problem.
> However, I was wondering if there was an easier way.

FWIW, I would generalize the ClassLoader a bit so that it treats the
JARs uniformly. For instance, always search for classes in the JARs in
order alphabetically by JAR file name (but not path). That way, you can
name your JARs like "1_log4j.jar" and "2_other_log4j.jar" or whatever.

It wasn't entirely clear how you implemented your ClassLoader but it
sounded like it might be /very/ specific to your exact requirements,
today. Doing something like alphabetical resolution by file name might
be re-usable in some other insane environment.

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message