Friday, September 07, 2007

Could not find destination factory for transport

A little tip, if you use CXF as a client to some web service, and am getting this exception:

org.apache.cxf.interceptor.Fault: Could not find destination factory for transport
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$
at org.apache.cxf.workqueue.SynchronousExecutor.execute(
Caused by: java.lang.RuntimeException: Could not find destination factory for transport
at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(
at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(
at org.apache.cxf.endpoint.UpfrontConduitSelector.selectConduit(
at org.apache.cxf.endpoint.ClientImpl.getConduit(
Then you are not alone, as I did too. Here is what I did to solve it: CXF uses spring xml for its configuration, so inside your spring config, do this:

<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml"/>

And you will need the cxf-rt-transports-http-jetty jarfile in classpath.


shahid_abd said...

Nice and knowledgeable sites for everyone-
Books and references
tutorial books

Mark McLaren said...

Very helpful, thank you very much. It is good to know you are not alone. The severe lack of documentation is making me want to stick with XFire for now!

Yuen-Chi Lian said...

Not alone ;-)


binkley said...

Wow, 2 years out and this post is still a life-saver. Thanks!

And second the old comment that CXF docs could be better. I'm working to refresh our tech stack from XFire to CXF and hitting roadblock that good documentation would clear up.