简体   繁体   English

JBOSS订购WEB-INF / lib的内容

[英]JBOSS ordering of contents of WEB-INF/lib

I have an ear file, containing a war file. 我有一个包含war文件的ear文件。 The war contains a number of jars in its WEB-INF/lib directory. 战争在其WEB-INF / lib目录中包含许多jar。 Some of these jars contain confilicting (or at least different ) versions of the same classes. 这些罐子中的一些包含相同类别的confilicting(或至少不同)版本。 Is there a way that I can influence the order that JBOSS will add these jar files on to the classpath? 有没有办法可以影响JBOSS将这些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. 例如,如果在a.jar和b.jar中找到com.dave.A.class,它们都在WEB-INF / lib中,并且我知道b.jar包含该类的“正确”版本,我如何确保JBOSS优先使用b.jar而不是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 这得到了.war文件中的类加载顺序

WEB-INF/classes is loaded before WEB-INF/lib 在WEB-INF / lib之前加载WEB-INF / classes

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Tomcat 5上控制WEB-INF / lib中jar的类路径排序? - Control the classpath ordering of jars in WEB-INF/lib on Tomcat 5? JBoss 6从WEB-INF / war of lib中解压缩jar - JBoss 6 unpacks jars from WEB-INF/lib of war JBoss 4.0.2 war部署中找不到WEB-INF / lib jar - WEB-INF/lib jars not found in JBoss 4.0.2 war deploy 使用 Eclipse 在 JBoss 上部署时 WEB-INF/lib 文件夹消失 - WEB-INF/lib folder disappears when deploying on JBoss with Eclipse / WEB-INF / classes vs / WEB-INF / lib - /WEB-INF/classes vs /WEB-INF/lib 将struts-core2.xxjar放在哪里? (在WEB-INF / lib或jboss共享库中) - where to put struts-core2.x.x.jar? (in WEB-INF/lib or jboss shared lib) 在JBOSS 7中,war文件可以访问ear / lib而非Web-inf / lib中的jar文件 - In JBOSS 7 can war file access a jar file located in ear/lib instead of web-inf/lib 如何使用JBoss EAP中的另一个jar覆盖WEB-INF / lib中jar中的某些类? - How to override some classes in a jar in WEB-INF/lib with another jar in JBoss EAP? 使用WEB-INF / lib中的jar文件而不是创建新的Jboss模块的JDBC数据源 - JDBC datasource using jar file in WEB-INF/lib instead of creating a new Jboss module JBoss:在application.war / WEB-INF / lib中部署JAR - JBoss: deployment of JAR's in application.war/WEB-INF/lib
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM