CXF异常 No DestinationFactory was found for the namespace http://schemas.xmlsoap.o

http://blog.csdn.net/running_snail_/article/details/7561067

最近学习webservice一运行就遇到了这个异常,郁闷。网上发现关于这个异常也是众说纷纭
[java] view plaincopy
Caused by: org.apache.cxf.service.factory.ServiceConstructionException 
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:134) 
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:160) 
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:322) 
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:244) 
... 16 more 
Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://schemas.xmlsoap.org/soap/http. 
at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:115) 
at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:86) 
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:69) 
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:115) 


经过一番折腾后终于可以了,原因一般有俩个:

1.是配置文件中缺少

[html] view plaincopy
<import resource="classpath:META-INF/cxf/cxf.xml" /> 
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> 
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> 

2.干脆就是jar包的问题
下载最新的CXF 将\lib下的所有jar导入,再运行,奇迹出现了

你可能感兴趣的:(webservice,CXF)