一,解决步骤
1.添加jar包
stax2-api-3.1.4.jar
woodstox-core-asl-4.4.1.jar
2.编写监听器
package com.neusoft.cxf.listener; import java.util.Properties; import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener; /**
* <p>Title: </p>
* <p>Description: weblogic容器部署CXF服务优先加载指定jar包</p>
* <p>Copyright:Copyright(c)2018</p>
* <p>Company:东软集团</p>
* @date 2018-04-25
* @author duanml
*/
public class CXFWeblogicListener implements ServletContextListener{ public CXFWeblogicListener() {
} @Override
public void contextDestroyed(ServletContextEvent arg0) { } @Override
public void contextInitialized(ServletContextEvent arg0) {
Properties props = System.getProperties();
props.setProperty("org.apache.cxf.stax.allowInsecureParser", "1");
} }
3.配置监听器
在web.xml下配置监听器
<!-- weblogic容器部署CXF服务监听器 -->
<listener>
<listener-class>com.neusoft.cxf.listener.CXFWeblogicListener</listener-class>
</listener>