在控制台模式下使用 Apache CXF JaxWsServerFactoryBean 时(尝试通过 java 命令行启动服务器)会出现如下异常:
Caused by: java.io.IOException: Cannot find any registered HttpDestinationFactory from the Bus.
at org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:295)
at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:143)
at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:93)
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:72)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:160)
当通过 Spring 在 Tomcat 中使用相同的服务 impl 时,它可以工作。
<jaxws:endpoint id="abc" implementor="com.AbcServicePortTypeImpl" address="/abc">