Started the Engineering Test WebService service yesterday, the results found that the service call Java.lang.RuntimeException:Cannot create a secure xmlinputfactory
Java.lang.RuntimeException:Cannot Create a secure Xmlinputfactoryat Org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory (staxutils.java:300) at Org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory (staxutils.java:255) at Org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader (staxutils.java:1346) at Org.apache.cxf.interceptor.StaxInInterceptor.handleMessage (staxininterceptor.java:112) at Org.apache.cxf.phase.PhaseInterceptorChain.doIntercept (phaseinterceptorchain.java:271) at Org.apache.cxf.transport.ChainInitiationObserver.onMessage (chaininitiationobserver.java:121) at Org.apache.cxf.transport.http.AbstractHTTPDestination.invoke (abstracthttpdestination.java:239) at Org.apache.cxf.transport.servlet.ServletController.invokeDestination (servletcontroller.java:223) at Org.apache.cxf.transport.servlet.ServletController.invoke (servletcontroller.java:203) at Org.apache.cxf.transport.servlet.ServletController.invoke (servletcontroller.java:137) at Org.apache.cxf.transport.servlet.CXFNonSpringServleT.invoke (cxfnonspringservlet.java:158) at Org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest ( abstracthttpservlet.java:243) at Org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost ( abstracthttpservlet.java:163) at Javax.servlet.http.HttpServlet.service (httpservlet.java:727) at Org.apache.cxf.transport.servlet.AbstractHTTPServlet.service (abstracthttpservlet.java:219) at Weblogic.servlet.internal.stubsecurityhelper$servletserviceaction.run (stubsecurityhelper.java:227) at Weblogic.servlet.internal.StubSecurityHelper.invokeServlet (stubsecurityhelper.java:125) at Weblogic.servlet.internal.ServletStubImpl.execute (servletstubimpl.java:301)
The original project is 2.7.4 has been good, and then because of the MAVEN compiler relationship, replaced by 2.7.5 found this error, the Internet search to search everyone is just missing some jar package, such as:
Woodstox-core-asl-4.2.0.jar
Stax2-api-3.1.1.jar
But I have here, and then someone turned the original code to add parameters what, I thought: Need so much trouble, and I also looked at the anti-compilation code, did not see what the problem. Then someone said that it would be OK to run all the jar packs in the official cxf-2.7.5.zip.
Search a circle, there is no ideal solution, no way, had to think of ways. Finally found the answer is simple:
Because I this is WebLogic reported the mistake, because our production environment is WebLogic I also did not want to go to Tomcat to verify, but expect on Tomcat should be no problem.
WebLogic, we know that it will first load its own class library, in order to prevent conflicts, WebLogic in XML can be configured to load the user first. Think of here, I opened the WebLogic modules looked, sure enough ~ ~ ~
Sure enough, WebLogic brought Stax, so I suspect this is where it led to the conflict.
So I joined in the Weblogic.xml.
<wls:package-name>org.codehaus.stax2.*</wls:package-name>
In order to prevent Woodstox packet conflict, I simply add Woodstox com.ctc.wstx, such as the last line
After the test ~~~ok everything is fine.
Because in the Internet did not search the correct answer, specifically to open this blog, to facilitate the broad masses of beginners to solve the problem
Java.lang.RuntimeException:Cannot Create a secure xmlinputfactory error resolution
that appears with CXF 2.7.5