Xerces collusion
mikehoss42 Apr 11, 2014 10:29 AMWe use an older version of httpunit to do some screen-scraping in our application. As the story goes, this worked fine in our Glassfish 3 world but when we put it in Wildfly 8, we see this:
2014-04-10 17:39:36,343 ERROR [org.jboss.as.ejb3.invocation] (default task-16) JBAS014134: EJB Invocation failed on component RegistryDownloaderResource for method public javax.ws.rs.core.Response com.foo.registryengine.web.resources.RegistryDownloaderResource.post(com.foo.registryengine.web.model.RegistryDownloaderRequest) throws java.io.IOException,java.net.URISyntaxException,java.text.ParseException,com.foor.registryagent.exception.RegistryAgentException: javax.ejb.EJBException: JBAS014580: Unexpected Error
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInNoTx(CMTTxInterceptor.java:213) [wildfly-ejb3-8.0.1.Final-SNAPSHOT.jar:8.0.1.Final-SNAPSHOT]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:262) [wildfly-ejb3-8.0.1.Final-SNAPSHOT.jar:8.0.1.Final-SNAPSHOT]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.notSupported(CMTTxInterceptor.java:319) [wildfly-ejb3-8.0.1.Final-SNAPSHOT.jar:8.0.1.Final-SNAPSHOT]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:237) [wildfly-ejb3-8.0.1.Final-SNAPSHOT.jar:8.0.1.Final-SNAPSHOT]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.0.1.Final-SNAPSHOT.jar:8.0.1.Final-SNAPSHOT]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:260) [wildfly-ejb3-8.0.1.Final-SNAPSHOT.jar:8.0.1.Final-SNAPSHOT]
[lots of lines snipped]
... 146 more
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.xni.XNIException from [Module "deployment.registryengineear-1.8-SNAPSHOT.ear.htmlunit.jar:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
... 190 more
So we started looking at the versions and saw that Wildfly 8 has the same version of Xerces in modules/system/layers/base/org/apache/xerces/main/ that httpunit was using. We tried to mark Xerces as provided in our Maven POM but we got the same error. We tried to upgrade to the latest httpunit, which uses a new version of Xerces and we got a similar error but with DocumentFactoryImpl.
Anyone have ideas on how to work around this?