[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] NPE from RegistryStrategyOSGI.onStop()

Hi Jason,

I have not looked into the problem, but on the surface it sounds like a bug.  Please open a bug against Equinox-Bundles so we can track the issue.  Thanks.


"Jason Hao" <jason.hao@xxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx

10/20/2006 02:52 AM

Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

[equinox-dev] NPE from RegistryStrategyOSGI.onStop()

Hi all,

I'm working on a project which is based on OSGi and equinox. The project also includes equinox extension registry bundle. Since my extensions are defined in files which are not in side the bundles, I need to load these extensions into registry by IExtensionRegistry.addContribution() method. And addContribution() method needs the master token which is under control of equinox registry bundle and I can't get it, so I have to create my registry instead of using the default registry. Here are what I have done.

1.        Add "-Declipse.createRegistry=false" into VM arguments. This will disable the default registry.
2.        Create my extension registry component and register it with declarative service spec. In the activate() method I creat my OSGi strategy and registry. In the deactivate() method I call IExtensionRegistry.stop() method to stop the registry.
3.        Start my application and the registry works well.
4.        Shutdown the OSGi framework by typing "shutdown" command in the console. org.eclipse.core.internal.registry.osgi.Activator.stop () method is called and the bundle context is set to null. Then my registry deactivate() method is called. I got java.lang.NullPointerException from org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.onStop(RegistryStrategyOSGI.java :204) since the bundle context is null.
I wonder if there's any way I can work around. Thanks.

Best Regards,

Jason Hao
equinox-dev mailing list