How to configure classloading precedence of jars in EAP 6 ?
Issue
-
We have a war file which has two jars which contains different version of same class, so how to define the classloading precedence in between these jars?
-
For example we have
test.warwhich depends on aA.jarfile. test.war contains 2 jars in theWEB-INF/libdirectory i.eA.jarandB.jaras follows:
test.war
|
WEB-INF/lib
|
+-A.jar
| |
| +-com/Example.class (supposed to override B.jar's )
|
+-B.jar
|
+-com/Example.class
- We would like
A.jarclasses to Patch theB.jar. HereA.jarcontainsExample.classfile that is supposed to overwrite one of its dependencyB.jar's Example.class. But while deploying the test.war in EAP 6, JBoss is by default not overriding in the manner as mentioned above so is there any configurations (like thejboss-deployment-structure.xml) which can be done in order to override theB.jarsource files withA.jarsource files without changing contents ofB.jar?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
