Friday, September 07, 2007

Could not find destination factory for transport http://schemas.xmlsoap.org/soap/http

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 http://schemas.xmlsoap.org/soap/http
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:85)
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:82)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:56)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
Caused by: java.lang.RuntimeException: Could not find destination factory for transport http://schemas.xmlsoap.org/soap/http
at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:148)
at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:73)
at org.apache.cxf.endpoint.UpfrontConduitSelector.selectConduit(UpfrontConduitSelector.java:71)
at org.apache.cxf.endpoint.ClientImpl.getConduit(ClientImpl.java:417)
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.

4 comments:

shahid_abd said...

Nice and knowledgeable sites for everyone-
books
booksshelf
knowledge
books
liberary
kitaben
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 ;-)

yc

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.