开发者

JBOSS ordering of contents of WEB-INF/lib

I have an ear file, containing a war file. The war contains a number of jars in its WEB-INF/lib directory. Some of these jars contain confilicting (or at least different ) versions of the 开发者_如何学JAVAsame classes. Is there a way that I can influence the order that JBOSS will add these jar files on to the classpath?

For example, if com.dave.A.class is found in a.jar and b.jar, both of which are in WEB-INF/lib, and I know that b.jar contains the "correct" version of the class, how do I ensure that JBOSS uses b.jar in preference to a.jar.

I'm aware that this makes my application extremely fragile, so please don't flame me for that :)


No, I don't believe you can dictate any control over this. If you're lucky, the classloader wil lload them in the "correct" order.

You really need to sort out the libraries so that there are no conflicts, by repacking them, if necessary.


This got answered in Order of class loading from a .war file

WEB-INF/classes is loaded before WEB-INF/lib

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜