Reputation: 21
I have two war files: A and B with web services using CXF
A uses web service in B.
B uses web service in A.
Everything is working fine in Tomcat. But when i deployed in Jboss, i am facing linkage error.
Caused by: java.lang.LinkageError: loader constraint violation: when resolving overridden method "org.apache.cxf.jaxws.ServiceImpl.createDispatch(Ljavax/xml/ws/EndpointReference;Ljavax/xml/bind/JAXBContext;Ljavax/xml/ws/Service$Mode;[Ljavax/xml/ws/WebServiceFeature;)Ljavax/xml/ws/Dispatch;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, org/apache/cxf/jaxws/ServiceImpl, and its superclass loader (instance of ), have different Class objects for the type javax/xml/bind/JAXBContext used in the signature
I have removed jaxb-api-2.2.3.jar and jaxb-impl-2.2.4-1.jar from the war and tested. Still i am facing the same issue.
What is the reason? Thanks in advance.
Upvotes: 1
Views: 3303
Reputation: 2991
Depending on the version of JBoss you are using, there would be a version of jaxb jars included with it. Check your JBOSS_HOME/modules/system/layers/base folder.
If you want JBoss to ignore the jars it has and use your applications' instead, you will need to explicitly tell it to do so. This can be done using custom modules:
<folder_name>
/main/ and put your jars in it. <resource-root>
.For more details, check this link: https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7
Upvotes: 1