java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not a subtype

我的梦境 提交于 2019-12-05 04:36:00

问题


I am using Weblogic 12c. I m trying to deploy myApplication.war in Weblogic. While deploying i get bellow error.

An error occurred during activation of changes, please see the log for details.
Message icon - Error java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not a subtype
Message icon - Error javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not a subtype 

The same myApplication.war I am able to deploy in weblogic-10,Jboss and Tomcat. But not in weblgic-12c.

I googled and found that i need to include dependency for xercesImpl.jar. I included that but, That dint help. still I am facing the same issue.

I tried including some other dependency, those are.

        <dependency>
            <groupId>com.fasterxml.woodstox</groupId>
            <artifactId>woodstox-core</artifactId>
            <version>5.0.2</version>
        </dependency>

        <dependency>
             <groupId>org.codehaus.woodstox</groupId>
            <artifactId>woodstox-core-asl</artifactId>
            <version>4.4.1</version>
        </dependency> 

        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>stax2-api</artifactId>
            <version>3.1.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>woodstox-core-lgpl</artifactId>
            <version>4.4.1</version>
            <scope>compile</scope>
        </dependency>

the above dependency dint help. Any suggestion for trouble shooting the application,any link.

It seems to be very common problem with weblogic-12c. what is root cause of the exception?


回答1:


I add only one dependency in ear pom.xml. It's work for me in WLS 12.2.1.3.

<dependency>
        <groupId>com.fasterxml.woodstox</groupId>
        <artifactId>woodstox-core</artifactId>
        <version>5.0.2</version>
</dependency>

and another libs was exclude, such as org.codehaus.woodstox, stax-api




回答2:


In WebLogic.xml add:

<container-descriptor>
    <prefer-web-inf-classes>false</prefer-web-inf-classes>
</container-descriptor>


来源:https://stackoverflow.com/questions/42153342/java-util-serviceconfigurationerror-javax-xml-stream-xmlinputfactory-provider

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!