问题
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