7 Replies Latest reply on Apr 17, 2014 1:18 AM by Stephen Coy

    Xerces collusion

    Mike Hostetler Newbie

      We 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?

        • 1. Re: Xerces collusion
          Tomaz Cerar Master

          can you post structure of your deployment

          usually jar tf <name-of-deployment> does the trick.

           

          also do you have jboss-deployment-structure.xml and if you do, can you post it?

          • 2. Re: Xerces collusion
            Mike Hostetler Newbie

            No, we don't have a jboss-deployment-structure.xml file. That was our next step but decided to try here first.

             

            The ear listing:

             

            META-INF/

            META-INF/MANIFEST.MF

            app-client-beta.jar

            app-common-beta.jar

            antlr.jar

            apache-mime4j-benchmark.jar

            apache-mime4j-core.jar

            apache-mime4j-dom.jar

            apache-mime4j-examples.jar

            apache-mime4j-storage.jar

            axiom-api.jar

            axiom-impl.jar

            axis2-kernel.jar

            axis2-transport-http.jar

            axis2-transport-local.jar

            axis2.jar

            collections-generic.jar

            commons-beanutils.jar

            commons-chain.jar

            commons-cli.jar

            commons-codec.jar

            commons-collections.jar

            commons-configuration.jar

            commons-dbutils.jar

            commons-digester.jar

            commons-fileupload.jar

            commons-httpclient.jar

            commons-io.jar

            commons-lang.jar

            commons-lang3.jar

            commons-logging.jar

            commons-validator.jar

            cssparser.jar

            dom4j.jar

            geronimo-activation_1.1_spec.jar

            geronimo-javamail_1.4_spec.jar

            geronimo-jta_1.1_spec.jar

            geronimo-stax-api_1.0_spec.jar

            geronimo-ws-metadata_2.0_spec.jar

            guava.jar

            htmlunit-core-js.jar

            htmlunit.jar

            httpcore.jar

            javacsv.jar

            jaxen.jar

            jdom.jar

            json-simple.jar

            jsr311-api.jar

            log4j.jar

            META-INF/application.xml

            mvel2.jar

            mysql-connector-java.jar

            neethi.jar

            nekohtml.jar

            oro.jar

            foocommon.jar

            foodatasourceclient.jar

            fooservicesclient-RegAgent.jar

            fooservicescore-RegAgent.jar

            poi-ooxml-schemas.jar

            poi-ooxml.jar

            poi.jar

            registryengineclient.jar

            registryengineejb.jar

            registryenginetoolswar.war

            registryenginewar.war

            sac.jar

            serializer.jar

            servlet-api.jar

            slf4j-api.jar

            sslext.jar

            stax-api.jar

            stax2-api.jar

            struts-core.jar

            struts-taglib.jar

            struts-tiles.jar

            velocity-tools.jar

            velocity.jar

            woden-api.jar

            woden-impl-commons.jar

            woden-impl-dom.jar

            woodstox-core-asl.jar

            wsdl4j.jar

            xalan.jar

            xmlbeans.jar

            XmlSchema.jar

            META-INF/maven/

            META-INF/maven/foo/

            META-INF/maven/foo/registryengineear/

            META-INF/maven/foo/registryengineear/pom.xml

            META-INF/maven/foo/registryengineear/pom.properties

            • 3. Re: Xerces collusion
              Tomaz Cerar Master

              Mike Hostetler wrote:

               

              app-client-beta.jar

              app-common-beta.jar

              antlr.jar

              apache-mime4j-benchmark.jar

              apache-mime4j-core.jar

              apache-mime4j-dom.jar

              apache-mime4j-examples.jar

              apache-mime4j-storage.jar

              axiom-api.jar

              axiom-impl.jar

              axis2-kernel.jar

              axis2-transport-http.jar

              axis2-transport-local.jar

              axis2.jar

              collections-generic.jar

              commons-beanutils.jar

              commons-chain.jar

              commons-cli.jar

              commons-codec.jar

              commons-collections.jar

              commons-configuration.jar

              commons-dbutils.jar

              commons-digester.jar

              commons-fileupload.jar

              commons-httpclient.jar

              commons-io.jar

              commons-lang.jar <-- you use both?

              commons-lang3.jar <-- you use both?

              commons-logging.jar <-- you could remove  it

              commons-validator.jar

              cssparser.jar

              dom4j.jar <-- another xml parser?

              geronimo-activation_1.1_spec.jar <-- remove part of JDK

              geronimo-javamail_1.4_spec.jar <-- remove part of app server

              geronimo-jta_1.1_spec.jar <-- remove part of app server

              geronimo-stax-api_1.0_spec.jar <-- remove

              geronimo-ws-metadata_2.0_spec.jar <-- remove

              guava.jar

              htmlunit-core-js.jar

              htmlunit.jar

              httpcore.jar

              javacsv.jar

              jaxen.jar <--anther xml parser?

              jdom.jar <-- yet another xml parser?

              json-simple.jar

              jsr311-api.jar <-- you can remove this

              log4j.jar <-- this could be removed

              META-INF/application.xml

              mvel2.jar

              mysql-connector-java.jar <-- jdbc driver should not be part of deployment as it is server managed

              neethi.jar

              nekohtml.jar

              oro.jar

              foocommon.jar

              foodatasourceclient.jar

              fooservicesclient-RegAgent.jar

              fooservicescore-RegAgent.jar

              poi-ooxml-schemas.jar

              poi-ooxml.jar

              poi.jar

              registryengineclient.jar

              registryengineejb.jar

              registryenginetoolswar.war

              registryenginewar.war

              sac.jar

              serializer.jar  <-- remove

              servlet-api.jar <-- remove

              slf4j-api.jar <-- could be removed

              sslext.jar

              stax-api.jar <-- you can remove this

              stax2-api.jar <-- you should remove this

              struts-core.jar

              struts-taglib.jar

              struts-tiles.jar

              velocity-tools.jar

              velocity.jar

              woden-api.jar

              woden-impl-commons.jar

              woden-impl-dom.jar

              woodstox-core-asl.jar

              wsdl4j.jar <-- you probably dont need this

              xalan.jar <-- probably causing you problems, try removing it

              xmlbeans.jar <-- probably safe to remove

              XmlSchema.jar <-- probably safe to remove

              • 4. Re: Xerces collusion
                Mike Hostetler Newbie

                We cleaned up a lot of our jars out but now we still get the exception upon deployment. Xerces is not in our .ear file

                 

                Do we need a jboss-deployment-structure.xml file?

                • 5. Re: Xerces collusion
                  Brandon Lederer Newbie

                  I can just add that the following is the list of jars now:

                   

                  agnis-client-beta.jar

                  agnis-common-beta.jar

                  axis2.jar

                  commons-beanutils.jar

                  commons-codec.jar

                  commons-collections.jar

                  commons-configuration.jar

                  commons-dbutils.jar

                  commons-httpclient.jar

                  commons-io.jar

                  commons-lang.jar

                  commons-lang3.jar

                  commons-logging.jar

                  cssparser.jar

                  dom4j.jar

                  guava.jar

                  htmlunit-core-js.jar

                  htmlunit.jar

                  javacsv.jar

                  json-simple.jar

                  META-INF

                  mvel2.jar

                  nekohtml.jar

                  ottrcommon.jar

                  ottrdatasourceclient.jar

                  ottrservicesclient-RegAgent.jar

                  ottrservicescore-RegAgent.jar

                  poi-ooxml-schemas.jar

                  poi-ooxml.jar

                  poi.jar

                  registryengineclient.jar

                  registryengineejb.jar

                  registryenginetoolswar.war

                  registryenginewar.war

                  sac.jar

                  stax-api.jar

                  xml-apis.jar

                  xmlbeans.jar

                  • 6. Re: Xerces collusion
                    Brandon Lederer Newbie

                    The solution was a jboss-deployment-structure.xml file.

                     

                    <?xml version="1.0" encoding="UTF-8"?> 

                    <jboss-deployment-structure> 

                        <deployment> 

                             <dependencies> 

                                  <module name="org.apache.xerces" /> 

                                  <module name="org.apache.xalan" /> 

                            </dependencies> 

                        </deployment> 

                    </jboss-deployment-structure> 

                    • 7. Re: Xerces collusion
                      Stephen Coy Master

                      You can also lose:

                           stax-api.jar

                           xml-apis.jar (which is particularly evil)

                       

                      I'd also consider whether or not Axis 2 is necessary as well. WildFly already provides a full featured WS implementation.