Quantcast

Karaf +Camel Blueprint not able to load bean from other active bundles.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Karaf +Camel Blueprint not able to load bean from other active bundles.

kumar

Hi ,

We are using Blueprint + Camel + Karaf ,migrating from Spring .
I am new to OSgi Blueprint . We are using Blueprint XML to define services from beans defined in blueprint xml.

After we added Service in Blueprint XML, atleast are getting from karaf as below:
fyi: bundle  is in Active state
karaf>service:list | grep custom
[org.apache.camel.Processor, com.rnd.model.impl.PaymentServiceProcessorBase, com.rnd.generic.CustomServiceProcessor]
 osgi.service.blueprint.compname = customPaymentProcessor

I am sure bean is registering into OSGI Services. but somehow its not visible to other XML in other Bundle.

Blueprint XML::
<bean id="customPaymentProcessor" class="blah blah"/>
<service ref="customPaymentProcessor" auto-export="all-classes"/>

Please help me how to get accesss this bean in Routes XML file in APPConfig(under karaf root Dir) Folder.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Karaf +Camel Blueprint not able to load bean from other active bundles.

Quinn Stevenson
Under Blueprint, beans are not directly available across Blueprint contexts.  Exposing the beans as services (as you have done) is how you expose them for consumption by other bundles, but you need to reference the services - not the beans directly.

<reference …../>

> On Mar 14, 2017, at 10:18 AM, kumar <[hidden email]> wrote:
>
>
> Hi ,
>
> We are using Blueprint + Camel + Karaf ,migrating from Spring .
> I am new to OSgi Blueprint . We are using Blueprint XML to define services
> from beans defined in blueprint xml.
>
> After we added Service in Blueprint XML, atleast are getting from karaf as
> below:
> fyi: bundle  is in Active state
> karaf>service:list | grep custom
> [org.apache.camel.Processor, com.rnd.model.impl.PaymentServiceProcessorBase,
> com.rnd.generic.*CustomServiceProcessor*]
> osgi.service.blueprint.compname = *customPaymentProcessor*
>
> I am sure bean is registering into OSGI Services. but somehow its not
> visible to other XML in other Bundle.
>
> *Blueprint XML*::
> <bean id="customPaymentProcessor" class="blah blah"/>
> <service ref="customPaymentProcessor" auto-export="all-classes"/>
>
> Please help me how to get accesss this bean in Routes XML file in
> APPConfig(under karaf root Dir) Folder.
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Karaf-Camel-Blueprint-not-able-to-load-bean-from-other-active-bundles-tp5795454.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Loading...