Trying to deploy a war on Wildfly 10.0.0. Final standalone got the following error :
java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.axis.description.TypeDesc.setXmlType(Ljavax/xml/namespace/QName;)V"
the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, mypackage/MyClass,
and the class loader (instance of org/jboss/modules/ModuleClassLoader) for the method's defining class, org/apache/axis/description/TypeDesc,
have different Class objects for the type javax/xml/namespace/QName used in the signature
wildfly-10.0.0.Final\modules\org\apache\axis\jaxrpc\main\axis-jaxrpc-1.4.jar\javax\xml\namespace\QName.class major version: 47
jdk1.8.0_60\jre\lib\rt.jar\javax\xml\namespace\QName.class major version: 52
I have read the Class Loading in WildFly but have no idea what the proper "specific order" is:
A common source of errors in Java applications is including API classes in a deployment that are also provided by the container. This can result in multiple versions of the class being created and the deployment failing to deploy properly. To prevent this in WildFly, module dependencies are added in a specific order that should prevent this situation from occurring.
jboss-deployment-structure.xml contains:
<module name="org.apache.axis.axis" />
pom.xml contains:
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
<scope>provided</scope>
</dependency>
wildfly-10.0.0.Final\modules\org\apache\axis\axis\main\module.xml:
<module xmlns="urn:jboss:module:1.1" name="org.apache.axis.axis">
<resources>
<resource-root path="axis-1.4.jar"/>
</resources>
<dependencies>
<module name="org.apache.axis.jaxrpc"/>
<module name="org.apache.axis.saaj"/>
<module name="org.apache.axis.wsdl4j"/>
<module name="org.apache.commons.discovery"/>
<module name="org.apache.commons.logging"/>
<module name="javax.activation.api"/>
<module name="javax.api"/>
<module name="javax.mail.api"/>
<module name="javax.servlet.api"/>
</dependencies>
</module>
wildfly-10.0.0.Final\modules\org\apache\axis\jaxrpc\main\module.xml:
<module xmlns="urn:jboss:module:1.1" name="org.apache.axis.jaxrpc">
<resources>
<resource-root path="axis-jaxrpc-1.4.jar"/>
</resources>
</module>