karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Freeman Fang <freeman.f...@gmail.com>
Subject Re: CXF - No DestinationFactory for Http Transport
Date Thu, 08 Jan 2015 09:53:42 GMT

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
>         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

View raw message