tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: Loading Jar files in a particular order on Tomcat 6
Date Sun, 11 Oct 2009 13:09:06 GMT
One more way:

You can use VirtualWebappLoader
http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/loader/VirtualWebappLoader.html

It adds the listed classpath entries to the webapp classloader.
I do not know, whether it appends or prepends them, and as that is not
documented it can be different between versions, but the following is
certain: the libraries listed in virtualClasspath attribute are added
in that very order with respect to each other.

So, you can remove those conflicting libraries from WEB-INF/lib, e.g.
move them to /WEB-INF/lib2, and add them in that particular order that
you need.

Note, that you can reference Java properties in any values in the context file.
E.g. ${catalina.base}/webapps/myapp/WEB-INF/lib2/mylib.jar should work.

Wildcards, e.g. *.jar, are not supported.

The downside is that VirtualWebappLoader is not so widely used, and so
there may be not so much experience with it, but you may give it a
try.

Best regards,
Konstantin Kolinko

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


Mime
View raw message