3 Replies Latest reply on Jul 28, 2017 10:25 AM by Ângelo Ricardo Costa

    How to set woodstox as default parser in wildfly 8.2.0

    sridhar thiyagarajan Novice

      Hello,

       

      I am migrating my application from JBoss 6 AS to Wildfly 8.2.0-Final AS. In the application, woodstox parser is used and and hence, in Wildfly 8.2.- Final AS, the below VM arguments are added:

       

      VM arguments added:

       

      woodstox and stax jars in boot classpath:

       

          -Xbootclasspath/a:$JBOSS_HOME/modules/system/layers/base/org/codehaus/woodstox/main/woodstox-core-asl-4.2.0.jar -Xbootclasspath/a:$JBOSS_HOME/modules/system/layers/base/org/codehaus/woodstox/main/stax2-api-3.1.1.jar

       

      factory classes from woodstox:

       

          JAVA_OPTS="$JAVA_OPTS -Djavax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory"

          JAVA_OPTS="$JAVA_OPTS -Djavax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory"

          JAVA_OPTS="$JAVA_OPTS -Djavax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory"

       

      But, default parser is getting set as captured from server.log. Please help in setting the woodstox as the default parser in wildfly.

       

       

          javax.xml.stream.XMLEventFactory = __redirected.__XMLEventFactory

          javax.xml.stream.XMLInputFactory = __redirected.__XMLInputFactory

          javax.xml.stream.XMLOutputFactory = __redirected.__XMLOutputFactory


      Line of code where this problem occurs:


      XMLInputFactory2 xmlImputFactory = (XMLInputFactory2) XMLInputFactory2.newInstance();


      Error obtained:


      java.lang.ClassCastException: __redirected.__XMLInputFactory cannot be cast to org.codehaus.stax2.XMLInputFactory2