When use Apache CXF JaxWsServerFactoryBean in console mode (try to start the server by java command line) Will get exception like below:
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)
When same service impl used in Tomcat via Spring, it works.
<jaxws:endpoint id="abc" implementor="com.AbcServicePortTypeImpl" address="/abc">
Include cxf-rt-transports-http-jetty jar in the maven pom.xml will solve the problem.
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>2.7.6</version>
</dependency>
For example, if you have below configuration and the address is defined with http appended to it, which is not a relative url to the CXFServlet configured, the above error will come.
<jaxrs:server id="helloRestService" address="http://...">
<jaxrs:serviceBeans>
<ref bean="helloService" />
</jaxrs:serviceBeans>
</jaxrs:server>
Solution is to simply mention the relative url without http/https appended to address.
http://grokbase.com/t/camel/users/155f1smn4v/error-cannot-find-any-registered-httpdestinationfactory-from-the-bus
Another solution which works with CSV 2.7.15: when you create the Bus, register an extension:
ServletDestinationFactory destinationFactory = new ServletDestinationFactory();
bus.setExtension(destinationFactory, HttpDestinationFactory.class);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With