WEB-INF/lib的内容的JBOSS排序 [英] JBOSS ordering of contents of WEB-INF/lib

查看:70
本文介绍了WEB-INF/lib的内容的JBOSS排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个耳塞文件,其中包含一个战争文件.战争在其WEB-INF/lib目录中包含许多jar.其中一些jar包含相同类的冲突(或至少不同)版本.有什么方法可以影响JBOSS将这些jar文件添加到类路径的顺序吗?

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 same classes. Is there a way that I can influence the order that JBOSS will add these jar files on to the classpath?

例如,如果在a.jar和b.jar中找到了com.dave.A.class,它们都在WEB-INF/lib中,并且我知道b.jar包含的正确"版本该类,如何确保JBOSS优先于a.jar使用b.jar.

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.

我知道这使我的应用程序非常脆弱,所以请不要为此而flame恼:)

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.

这篇关于WEB-INF/lib的内容的JBOSS排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆