You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bruno Dusausoy <br...@yp5.be> on 2011/05/30 09:45:28 UTC
DestinationFactory not found
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.
Re: DestinationFactory not found
Posted by Bruno Dusausoy <br...@yp5.be>.
On 05/30/2011 12:50 PM, Sergey Beryozkin wrote:
[...]
> That is interesting, though a bit unexpected as I can see the
> identical code in 2.3.4 and 2.4.0, as far as the defaulting of the
> trandportId is concerned.
> Can you give me a favor and clarify a couple of things...
> Were you getting the same "No DestinationFactory was found for the
> namespace http://schemas.xmlsoap.org/wsdl/soap/http" with 2.3.4 ?
> Do you have Spring libs on the runtime classpath ?
> Is http-jetty dependency included given that you use an absolute HTTP address ?
>
> Just trying to figure out only some users do get this exception with 2.3.x
>
Sure, just give me a few hours (or a day at most) and I'll try a bunch
of configurations.
--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.
Re: DestinationFactory not found
Posted by Sergey Beryozkin <sb...@gmail.com>.
thanks for the confirmation, the http-jetty transport also supports
the soap based URI, that is why it works.
Actually, I recall now that defaulting transportId to a more neutral
value was mainly about avoiding the confusing messages (where does
soap-aware DestinationFactory come in in the first place ?) in case of
JAX-RS frontends failing to get DestinationFactory located.
Cheers, Sergey
On Mon, May 30, 2011 at 2:35 PM, Bruno Dusausoy <br...@yp5.be> wrote:
> On 05/30/2011 02:55 PM, Sergey Beryozkin wrote:
>>
>> Thanks...I'm wondering if explicitly adding a
>> cxf-rt-transports-http-jetty dependency can help, that issue does not
>> exist with the servlet transport being involved...
>> Please, send me the test project if you can and I will look into it
>>
>
> Bullseye !
> Indeed, when adding the dependency you've suggested it works equally well
> for 2.3.3 and 2.3.4 !
> More interesting for you, it works *without* your workaround, no need to set
> the transportId programmatically, even for 2.3.3.
>
> Thanks a lot.
>
> Regards.
>
> --
> Pensez environnement : limitez l'impression de ce mail.
> Please don't print this e-mail unless you really need to.
>
Re: DestinationFactory not found
Posted by Bruno Dusausoy <br...@yp5.be>.
On 05/30/2011 02:55 PM, Sergey Beryozkin wrote:
> Thanks...I'm wondering if explicitly adding a
> cxf-rt-transports-http-jetty dependency can help, that issue does not
> exist with the servlet transport being involved...
> Please, send me the test project if you can and I will look into it
>
Bullseye !
Indeed, when adding the dependency you've suggested it works equally
well for 2.3.3 and 2.3.4 !
More interesting for you, it works *without* your workaround, no need to
set the transportId programmatically, even for 2.3.3.
Thanks a lot.
Regards.
--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.
Re: DestinationFactory not found
Posted by Sergey Beryozkin <sb...@gmail.com>.
Thanks...I'm wondering if explicitly adding a
cxf-rt-transports-http-jetty dependency can help, that issue does not
exist with the servlet transport being involved...
Please, send me the test project if you can and I will look into it
Cheers, Sergey
On Mon, May 30, 2011 at 1:47 PM, Bruno Dusausoy <br...@yp5.be> wrote:
> On 05/30/2011 12:50 PM, Sergey Beryozkin wrote:
> [...]
>>
>> That is interesting, though a bit unexpected as I can see the
>> identical code in 2.3.4 and 2.4.0, as far as the defaulting of the
>> trandportId is concerned.
>> Can you give me a favor and clarify a couple of things...
>> Were you getting the same "No DestinationFactory was found for the
>> namespace http://schemas.xmlsoap.org/wsdl/soap/http" with 2.3.4 ?
>> Do you have Spring libs on the runtime classpath ?
>> Is http-jetty dependency included given that you use an absolute HTTP
>> address ?
>>
>> Just trying to figure out only some users do get this exception with 2.3.x
>>
>
> Yes, it's the same stack trace, excepting the line number for
> JaxRsServerFactoryBean (line 145 for 2.3.3 vs line 160 for 2.3.4).
> Same exception whether or not I put your workaround.
>
> Yes, I have Spring 3.0.5.RELEASE in my runtime classpath.
> The only thing I've changed is the version of CXF in my POM, no dependencies
> added or removed.
>
> Hope this helps.
>
> Regards, Bruno.
>
> PS : I'll try to do a simple maven project to highlight the problem.
>
> --
> Pensez environnement : limitez l'impression de ce mail.
> Please don't print this e-mail unless you really need to.
>
Re: DestinationFactory not found
Posted by Bruno Dusausoy <br...@yp5.be>.
On 05/30/2011 12:50 PM, Sergey Beryozkin wrote:
[...]
>
> That is interesting, though a bit unexpected as I can see the
> identical code in 2.3.4 and 2.4.0, as far as the defaulting of the
> trandportId is concerned.
> Can you give me a favor and clarify a couple of things...
> Were you getting the same "No DestinationFactory was found for the
> namespace http://schemas.xmlsoap.org/wsdl/soap/http" with 2.3.4 ?
> Do you have Spring libs on the runtime classpath ?
> Is http-jetty dependency included given that you use an absolute HTTP address ?
>
> Just trying to figure out only some users do get this exception with 2.3.x
>
Yes, it's the same stack trace, excepting the line number for
JaxRsServerFactoryBean (line 145 for 2.3.3 vs line 160 for 2.3.4).
Same exception whether or not I put your workaround.
Yes, I have Spring 3.0.5.RELEASE in my runtime classpath.
The only thing I've changed is the version of CXF in my POM, no
dependencies added or removed.
Hope this helps.
Regards, Bruno.
PS : I'll try to do a simple maven project to highlight the problem.
--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.
Re: DestinationFactory not found
Posted by Sergey Beryozkin <sb...@gmail.com>.
On Mon, May 30, 2011 at 10:48 AM, Bruno Dusausoy <br...@yp5.be> wrote:
> On 05/30/2011 11:08 AM, Sergey Beryozkin wrote:
>>
>> 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");
>> ...
>>
>
> Unfortunately that didn't do the trick on 2.3.3 nor on 2.3.4, still the same
> issue.
> But it works well on 2.4.0 !
That is interesting, though a bit unexpected as I can see the
identical code in 2.3.4 and 2.4.0, as far as the defaulting of the
trandportId is concerned.
Can you give me a favor and clarify a couple of things...
Were you getting the same "No DestinationFactory was found for the
namespace http://schemas.xmlsoap.org/wsdl/soap/http" with 2.3.4 ?
Do you have Spring libs on the runtime classpath ?
Is http-jetty dependency included given that you use an absolute HTTP address ?
Just trying to figure out only some users do get this exception with 2.3.x
Thanks, Sergey
>
> So I think I will stick to the latest version.
>
> Thanks a lot !
>
> Regards.
> --
> 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
Re: DestinationFactory not found
Posted by Bruno Dusausoy <br...@yp5.be>.
On 05/30/2011 11:08 AM, Sergey Beryozkin wrote:
> 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");
> ...
>
Unfortunately that didn't do the trick on 2.3.3 nor on 2.3.4, still the
same issue.
But it works well on 2.4.0 !
So I think I will stick to the latest version.
Thanks a lot !
Regards.
--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.
Re: DestinationFactory not found
Posted by Sergey Beryozkin <sb...@gmail.com>.
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 <br...@yp5.be> 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