eclipse运行jaxws报错:Cannot find any registered HttpDestinationFactory from the Bus

转自:http://iteye.blog.163.com/blog/static/186308096201210265553996/

严重: Cannot find any registered HttpDestinationFactory from the Bus解决方案  

一、控制台异常信息:
  1. 严重: Cannot find any registered HttpDestinationFactory from the Bus.  
  2. Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException  
  3.     at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:350)  
  4.     at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:239)  
  5.     at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:144)  
  6.     at javax.xml.ws.Endpoint.publish(Endpoint.java:170)  
  7.     at demo.hw.server.Server.<init>(Server.java:31)  
  8.     at demo.hw.server.Server.main(Server.java:36)  
  9. Caused by: org.apache.cxf.service.factory.ServiceConstructionException  
  10.     at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:176)  
  11.     at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:203)  
  12.     at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:433)  
  13.     at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:322)  
  14.     ... 5 more  
  15. Caused by: java.io.IOException: Cannot find any registered HttpDestinationFactory from the Bus.  
  16.     at org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:270)  
  17.     at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:136)  
  18.     at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:93)  
  19.     at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:72)  
  20.     at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:158)  
  21.     ... 8 more 
 
二、解决方案:
在使用cxf过程中经常出 Cannot find any registered HttpDestinationFactory from the Bus,一般是没有引入cxf-rt-transports-http-jetty-xxx.jar。查看apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:270)类,jettyFactory为null,也就是缺少http-jetty的实现。如果部署到tomcat一般不会出现这个问题。

修改pom.xml

 

<dependencies>
  <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-transports-http-jetty</artifactId>
      <version>2.4.5-SNAPSHOT</version>
  </dependency>
     </dependencies>

 

<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>2.4.6</version>
</dependency>
</dependencies>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值