您的位置:首页 > 理论基础 > 计算机网络

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

2012-05-12 21:41 741 查看
最近学习webservice一运行就遇到了这个异常,郁闷。网上发现关于这个异常也是众说纷纭

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.是配置文件中缺少

<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导入,再运行,奇迹出现了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐