You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Mohammad Shamsi <m....@gmail.com> on 2015/01/08 10:24:02 UTC
CXF - No DestinationFactory for Http Transport
Hi,
I've a relatively simple REST bundle, in karaf 2.3, with following
blueprint config:
<jaxrs:server id="foo-id" address="/foo">
<jaxrs:serviceBeans>
<bean id="bean-id" class="sample.Foo" />
</jaxrs:serviceBeans>
</jaxrs:server>
Sometimes, during karaf startup, following exception is thrown:
Caused by: org.apache.cxf.BusException: No DestinationFactory was
found for the namespace http://cxf.apache.org/transports/http.
at org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:130)
...
And therefore bundle installation (my rest bundle) fails.
As I said, the problem is happening randomly, i believe, depending on
bundles start order. Sometime the http-transport bundle is installed and
started after my bundle, which causes the above issue. If I refresh or
update my bundle, it starts successfully.
Given that http-transport is used by cxf and my bundle doesn't have direct
dependency to it (not using any package from it), How can i make sure that
http-transport starts before my bundle?
Cheers,
Mohammad Shamsi
Re: CXF - No DestinationFactory for Http Transport
Posted by mhshams <m....@gmail.com>.
I've tested the suggested solution, but apparently it's not working.
I am creating a mandatory reference of "DestinationRegistry" and even
injecting it to a another bean, but still can see the problem form time to
time.
Cheers,
--
View this message in context: http://karaf.922171.n3.nabble.com/CXF-No-DestinationFactory-for-Http-Transport-tp4037680p4037772.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: CXF - No DestinationFactory for Http Transport
Posted by Mohammad Shamsi <m....@gmail.com>.
Thanks Freeman, I'll give this a try.
On Thu Jan 08 2015 at 10:54:29 AM Freeman Fang <fr...@gmail.com>
wrote:
> Hi,
>
> Yeah, this error means your bundle get started before the
> cxf-rt-transports-http bundle.
>
> You can make your bundle import an OSGi
> service(org.apache.cxf.transport.http.DestinationRegistry) which is exposed
> by the cxf-rt-transports-http bundle to ensure cxf bundle get started
> reliably before your bundle
> -------------
> Freeman(Yue) Fang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
>
>
>
> On 2015-1-8, at 下午5:24, Mohammad Shamsi wrote:
>
>
> Hi,
>
> I've a relatively simple REST bundle, in karaf 2.3, with following blueprint config:
>
> <jaxrs:server id="foo-id" address="/foo">
> <jaxrs:serviceBeans>
> <bean id="bean-id" class="sample.Foo" />
> </jaxrs:serviceBeans>
> </jaxrs:server>
>
> Sometimes, during karaf startup, following exception is thrown:
>
> Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://cxf.apache.org/transports/http.
>
> at org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:130)
>
> ...
>
> And therefore bundle installation (my rest bundle) fails.
> As I said, the problem is happening randomly, i believe, depending on
> bundles start order. Sometime the http-transport bundle is installed and
> started after my bundle, which causes the above issue. If I refresh or
> update my bundle, it starts successfully.
>
> Given that http-transport is used by cxf and my bundle doesn't have direct
> dependency to it (not using any package from it), How can i make sure that
> http-transport starts before my bundle?
>
> Cheers,
> Mohammad Shamsi
>
>
>
Re: CXF - No DestinationFactory for Http Transport
Posted by Freeman Fang <fr...@gmail.com>.
Hi,
Yeah, this error means your bundle get started before the cxf-rt-transports-http bundle.
You can make your bundle import an OSGi service(org.apache.cxf.transport.http.DestinationRegistry) which is exposed by the cxf-rt-transports-http bundle to ensure cxf bundle get started reliably before your bundle
-------------
Freeman(Yue) Fang
Red Hat, Inc.
FuseSource is now part of Red Hat
On 2015-1-8, at 下午5:24, Mohammad Shamsi wrote:
>
> Hi,
>
> I've a relatively simple REST bundle, in karaf 2.3, with following blueprint config:
> <jaxrs:server id="foo-id" address="/foo">
> <jaxrs:serviceBeans>
> <bean id="bean-id" class="sample.Foo" />
> </jaxrs:serviceBeans>
> </jaxrs:server>
>
> Sometimes, during karaf startup, following exception is thrown:
> Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://cxf.apache.org/transports/http.
> at org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:130)
> ...
> And therefore bundle installation (my rest bundle) fails.
> As I said, the problem is happening randomly, i believe, depending on bundles start order. Sometime the http-transport bundle is installed and started after my bundle, which causes the above issue. If I refresh or update my bundle, it starts successfully.
>
> Given that http-transport is used by cxf and my bundle doesn't have direct dependency to it (not using any package from it), How can i make sure that http-transport starts before my bundle?
>
> Cheers,
> Mohammad Shamsi
>