Another solution would be to retrieve the BundleContext using FrameworkUtil and then use a ServiceTracker or obtain references from the OSGi registry. JNDI does leak service references so it should be avoided if possible.
On Thu, May 24, 2012 at 3:49 PM, Christian Schneider <[email protected]> wrote: > A pretty simple solution might be to use aries-jndi > (http://aries.apache.org/modules/jndiproject.html). > It allows to look up OSGi services using jndi. > > Christian > > > Am 24.05.2012 15:17, schrieb djos06: > >> Hi everyone, >> >> I'm developping an application with karaf which is composed on one .war >> (web >> application) and many osgi bundles. >> I succeded to install a .war into karaf using the war feature (as >> described >> on https://cwiki.apache.org/KARAF/66-installing-additional-features.html) >> but I don't know how to access beans declared in others osgi bundles from >> a >> jsp or a servlet of the .war >> Do you know a way to do it ? >> >> Thanks >> >> >> >> >> -- >> View this message in context: >> http://karaf.922171.n3.nabble.com/Accessing-to-OSGI-bean-from-a-War-tp4013519.html >> Sent from the Karaf - Dev mailing list archive at Nabble.com. > > > > -- > Christian Schneider > http://www.liquid-reality.de > > Open Source Architect > Talend Application Integration Division http://www.talend.com > -- ------------------------ Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ FuseSource, Integration everywhere http://fusesource.com
