cxf找不到类org.apache.axis.soap.MessageFactoryImpl出错

cxf找不到类org.apache.axis.soap.MessageFactoryImpl出错

 

错误信息如下:

Caused by: java.lang.ClassNotFoundException: org.apache.axis.soap.MessageFactoryImpl

    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

    at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:50)

    ... 10 more

处理:

原因是调用了axis soap.MessageFactoryImpl,cxf应该用的是sun
     在注册安全拦截器之前执行下面代码就可以了

System.setProperty("javax.xml.soap.MessageFactory", "com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");

你可能感兴趣的:(cxf找不到类org.apache.axis.soap.MessageFactoryImpl出错)