CXF 專案tomcat 釋出成功,weblogic 出現 Cannot create a secure XMLInputFactory 異常
阿新 • • 發佈:2019-07-30
問題:weblogic 部署專案出現 Cannot create a secure XMLInputFactory
七月 30, 2019 3:48:36 下午 org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging 警告: Interceptor for {mdm.csg.cn}CheckDataService has thrown exception, unwinding now java.lang.RuntimeException: Cannot create a secure XMLInputFactory at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:338) at org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory(StaxUtils.java:278) at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1723) at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:127) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) 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) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221) [15:48:36:600] [INFO] - cn.csg.drm.mdm.check.handler.CxfHandler.getHeaders(CxfHandler.java:23) - set qName [15:48:36:647] [ERROR] - cn.csg.drm.mdm.check.handler.CxfHandler.handleFault(CxfHandler.java:35) - handler Fault [15:48:36:648] [INFO] - cn.csg.drm.mdm.check.handler.CxfHandler.close(CxfHandler.java:41) - close <2019-7-30 下午03時48分41秒 CST> <Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on 0:0:0:0:0:0:0:1:55,360 during the configured idle timeout of 5 secs>
解決方案:在web-inf 目錄下新增:weblogic.xml
<?xml version="1.0" encoding="UTF-8"?> <weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.3/weblogic-web-app.xsd"> <container-descriptor> <index-directory-enabled>true</index-directory-enabled> <prefer-web-inf-classes>true</prefer-web-inf-classes> </container-descriptor> </weblogic-web-app>
總結:weblogic 與自定義jar 衝突,新增weblogic.xml 優先