Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

While migrating both JAX-RS and JAX-WS web services from WebLogic 12.1 to 12.2 I've come across an issue during deployment. The error "java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not a subtype" kept on coming up. The particular service in question wasn't using StAX but we've played around with changing various providers during this upgrade so I thought that was the root cause. It wasn't.

Here's a redacted version of the error message seen during deployment...
 Error
Failed to execute goal com.oracle.weblogic:weblogic-maven-plugin:12.2.1-3-0:deploy (wls-deploy) on project zzzz: weblogic.Deployer$DeployerException: weblogic.deploy.api.tools.deployer.DeployerException: Task 75 failed: [Deployer:149026]deploy application zzzz on zzzz.
Target state: deploy failed on Server zzzz
java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not a subtype
at weblogic.Deployer.run(Deployer.java:76)
at weblogic.Deployer.mainWithExceptions(Deployer.java:63)
at weblogic.tools.maven.plugins.deploy.DeployMojo.execute(DeployMojo.java:342)
...
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)


Turned out the issue was to do with class loading and specifically what weblogic.xml contained. Because these services were using Oracle Coherence from WebLogic 12.1 they were providing a tangosol-coherence-override.xml file as part of the WAR package. This required the prefer-web-inf-classes element in weblogic.xml to be set to true. This caused the StAX exception to be thrown.

Setting prefer-web-inf-classes to false resolved the issue...
 weblogic.xml
<container-descriptor>
<prefer-web-inf-classes>false</prefer-web-inf-classes>
</container-descriptor>


So either something in the WLS class loader structure changed between 12.1 and 12.2 or some other dependencies changed, I've not tried to track it down too hard. What about Coherence and the override file? Well it looks like due to these changes in WLS 12.2 that certain services are not able to make use of this feature any more. I'll have a separate article on that and a couple of workarounds to deal with it too.

-i

Skip down to comments...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...