ClassLoader error when importing or exporting BPMN diagrams with WebLogic
Compatible Application Servers
Problem
Under some circumstances, when importing or exporting a BPMN file using WebLogic, you may run into ClassLoader errors. You may get an error similar to:
ClassLoader error
JAVA
2018-05-24 10:24:25 ERROR GlobalExceptionResolver - Handler dispatch
failed; nested exception is java.lang.LinkageError: loader constraint
violation in interface itable initialization: when resolving method
"org.apache.xpath.jaxp.XPathImpl.getNamespaceContext()Ljavax/xml/namespace/NamespaceContext;"
the class loader (instance of
weblogic/utils/classloaders/ChangeAwareClassLoader) of the current
class, org/apache/xpath/jaxp/XPathImpl, and the class loader (instance
of <bootloader>) for interface javax/xml/xpath/XPath have
different Class objects for the type
javax/xml/namespace/NamespaceContext used in the signature
org.springframework.web.util.NestedServletException: Handler dispatch
failed; nested exception is java.lang.LinkageError: loader constraint
violation in interface itable initialization: when resolving method
"org.apache.xpath.jaxp.XPathImpl.getNamespaceContext()Ljavax/xml/namespace/NamespaceContext;"
the class loader (instance of
weblogic/utils/classloaders/ChangeAwareClassLoader) of the current
class, org/apache/xpath/jaxp/XPathImpl, and the class loader (instance
of <bootloader>) for interface javax/xml/xpath/XPath have
different Class objects for the type
javax/xml/namespace/NamespaceContext used in the signature
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1006)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
Solution
Because of the classloader issues the following files will need to be removed from the iGrafxWebApp.war file that is located inside the EAR file:
WEB-INF/lib/stax-api.jar