aspose file tools*
The moose likes Other Application Frameworks and the fly likes OSGI: OsgiBundleApplicationContextListener not listening to events from all bundles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "OSGI: OsgiBundleApplicationContextListener not listening to events from all bundles" Watch "OSGI: OsgiBundleApplicationContextListener not listening to events from all bundles" New topic
Author

OSGI: OsgiBundleApplicationContextListener not listening to events from all bundles

Manish Agarwal
Greenhorn

Joined: Jan 30, 2006
Posts: 20
Hi All,

I am trying to achieve a use case where I want to read an implementation of a particular interface from all bundles as soon as the bundle is started. So, initially I created a BundleListener and as soon as the bundle is started I tried to read the Osgi service from registry, but it did not work. Because Spring DM extender created the ApplicationContext for the bundle after the bundle is started.

So, I tried another solution where I created an OsgiBundleApplicationContextListener. But for some reason this listener listened to AppContextRefreshed event from only two bundles out of 10 bundles that I have.

Am I missing someting here, how can I receive AppContextRefreshed event from all bundles?

Note: I already posted this on Eclipse/virgo forum but did not get any reply, hence posting here again.

Thanks in advance.
Manish


SCWCD1.4, SCJP1.4, OCA 9i
ketan kashyap
Greenhorn

Joined: Apr 07, 2011
Posts: 1
Hi Manish

For OSGI to work in spring DM way, the osgi-context.xml where the service beans registered in the OSGI registry are referred, check the beans are rightly referred in the osgi context xml file. the reason i am pointing this is as you said only 2 bundles are listening to events.


thanks,
ketan
 
 
subject: OSGI: OsgiBundleApplicationContextListener not listening to events from all bundles