I recall having this problem years ago but don't remember the cause. I don't think defining a bundle activator will help. How are you installing these bundles? Do any of them have an activation policy in the manifest? I would think that installing them all via a karat feature would result in them all getting started, but I haven't used karat in years and am not 100% sure.
david jencks On Jul 24, 2014, at 8:45 AM, "Leschke, Scott" <[email protected]> wrote: > Yes, they are. I've used DataNucleus without problems in the past in > Eclipse/Equinox . I've also looked at the MANIFEST.MF files to check the > IMPORT/EXPORT-PACKAGE clauses. > > I just think that the class in question is loaded and executing in the > RESOLVED state, which is possible/valid I guess. I guess I always assumed > that the first class to load in a bundle would be the activator if it's > specified. > > Assuming that's the case, it would seem that the only way for a class to > guarantee that it can get access to its BundleContext is to declare an > activator and do it after the activator runs. > > -----Original Message----- > From: jkraushaar [mailto:[email protected]] > Sent: Thursday, July 24, 2014 2:17 AM > To: [email protected] > Subject: RE: Null BundleContext in class > > Hi Scott, > > are you sure that both bundles are valid OSGi bundles? I had similar problems > in the past when I've installed JAR without OSGi meta informations. > The framework told me that it has the state ACTIVE, but it was not a bundle > at all. > > Regards > Jochen > > > > -- > View this message in context: > http://karaf.922171.n3.nabble.com/Null-BundleContext-in-class-tp4034413p4034421.html > Sent from the Karaf - User mailing list archive at Nabble.com.
