loader constraint violation

Following error related to AXIS2 comes up when there is cross-reference to different class with same name (and same package). This is possible when different aar files are deployed containing same file in same package structure.

 

(http-127.0.0.1-8080-1) [ERROR] loader constraint violation: when resolving method "com.Abc$Factory.parse(Ljavax/xml/stream/XMLStreamReader;)Lcom/Abc;" the class loader (instance of org/apache/axis2/deployment/DeploymentClassLoader) of the current class, com/Abc$Factory, and the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) for resolved class, com/Abc$Factory, have different Class objects for the type javax/xml/stream/XMLStreamReader used in the signature
java.lang.LinkageError: loader constraint violation: when resolving method "com.Abc$Factory.parse(Ljavax/xml/stream/XMLStreamReader;)Lcom/Abc;" the class loader (instance of org/apache/axis2/deployment/DeploymentClassLoader) of the current class, com/Abc$Factory, and the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) for resolved class, com/Abc$Factory, have different Class objects for the type javax/xml/stream/XMLStreamReader used in the signature
    at com.Abc$Factory.parse(Abc.java:332)

Leave a Reply

Your email address will not be published. Required fields are marked *