Reputation: 21
The class file DTDScanner, DocumentScanner is loading from two jar files com.ibm.ws.webservices.thinclient_8.5.0.jar (supplied by application through WEB-INF/lib) and com.ibm.ws.xlxp.1.5.3_1.0.16.jar supplied by Liberty profile liberty. These class file have java.lang.LinkageError: loader constraint violation because it is loaded by two different class loader.
Liberty Version : 17.0.0.1 Liberty - (17.0.0.1-cl170120170227-0220)
Here is the error java.util.concurrent.ExecutionException: java.lang.LinkageError: loader constraint violation: when resolving method "com.ibm.xml.xlxp2.scan.util.EntityManager.<init>(Lcom/ibm/xml/xlxp2/scan/util/EntityManager$EntitySupport;Lcom/ibm/xml/xlxp2/scan/DocumentScanner;Lcom/ibm/xml/xlxp2/scan/util/SymbolTable;Lcom/ibm/xml/xlxp2/scan/util/ParsedEntityFactory;)V" the class loader (instance of com/ibm/ws/classloading/internal/AppClassLoader) of the current class, com/ibm/xml/xlxp2/scan/DTDScanner, and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for the method's defining class, com/ibm/xml/xlxp2/scan/util/EntityManager, have different Class objects for the type com/ibm/xml/xlxp2/scan/DocumentScanner used in the signature
[4:54]
How to load all the jar files in a single classloader if there is an need?
Upvotes: 1
Views: 731
Reputation: 2018
The thin client jars are not designed to be packaged within a Java EE application - they're intended for (as the name implies) standalone thin clients, providing some WebSphere APIs for use in those environments. Including them is going to produce a lot of class duplication between the server and your application, and LinkageErrors are a common side effect of that kind of duplication. Removing that jar from your app (it shouldn't contain anything that's not in the server itself) should resolve the issue.
Upvotes: 2