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...
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...

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.


A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.