Hi
Thanks for the detailed info, that issue has been resolved in 2.3.4,
the following workaround should fix it for you:
JAXRSServerFactoryBean sfb = new JAXRSServerFactoryBean();
sfb.setTransportId("http://cxf.apache.org/transports/http");
...
Cheers, Sergey
On Mon, May 30, 2011 at 8:45 AM, Bruno Dusausoy <[email protected]> wrote:
> Hi,
>
> I have a problem when programmatically creating a JAX-RS Endpoint.
> I get this exception :
>
> org.apache.cxf.service.factory.ServiceConstructionException
> [...]
> Caused by: org.apache.cxf.BusException: No DestinationFactory was found for
> the namespace http://schemas.xmlsoap.org/wsdl/soap/http.
> at
> org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:127)
> at
> org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:87)
> at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:71)
> at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:112)
> ... 28 more
>
> I've done some search on the net and found several bugreports[1], but I
> still can't get rid of this problem.
>
> Here's the code creating the server :
>
> private Server createServer() {
>
> JAXRSServerFactoryBean sfb = new JAXRSServerFactoryBean();
> sfb.setResourceClasses(RestComputationService.class);
> sfb.setResourceProvider(RestComputationService.class,
> new SingletonResourceProvider(RestComputationService.class));
> sfb.setAddress("http://localhost:9999");
> BindingFactoryManager manager =
> sfb.getBus().getExtension(BindingFactoryManager.class);
> JAXRSBindingFactory factory = new JAXRSBindingFactory();
> factory.setBus(sfb.getBus());
>
> manager.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID,
> factory);
>
> return sfb.create();
> }
>
> I have absolutely no problem deploying when creating a war and using
> CXFServlet with Spring in a Tomcat container.
> I'm using CXF 2.3.3.
>
> Any thoughts ?
>
> Regards.
>
> [1] https://issues.apache.org/jira/browse/CXF-1637, for example.
> --
> Pensez environnement : limitez l'impression de ce mail.
> Please don't print this e-mail unless you really need to.
>
--
Sergey Beryozkin
Application Integration Division of Talend
http://sberyozkin.blogspot.com