一.异常的信息
Caused by: 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:1798)
at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1697)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:215)
解决的办法:.搜索”org.apache.cxf.stax.allowInsecureParser”发现一篇解决这个问题的文章(http://blog.csdn.net/koudailidexiaolong/article/details/52239670),文章中采用的是监听器启动时重新设置系统属性来解决这个问题的 具体如下代码:
package com.shensu.listener;
import java.util.Properties;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class SealManageListener implements ServletContextListener {
@Override
public void contextDestroyed(ServletContextEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void contextInitialized(ServletContextEvent arg0) {
Properties props = System.getProperties();
props.setProperty("org.apache.cxf.stax.allowInsecureParser", "1");
}
}
7.最后部署,启动weblogic,控制台没有报错,在浏览器中访问wsdl地址http://localhost:7001/TestCXF/webs