NullPointerException when trying to programaticaly install a bundle in Equinox?

I ran into this problem as well, and I found that you don't get this error when using apache felix instead of equinox as the OSGi framework.

Up vote 3 down vote favorite share g+ share fb share tw.

I'm trying to do a simple demo where I start the Equinox Framework and then load a tutorial bundle that was created (via the tutorial). I keep getting NullPointerExceptions here is the stack trace... Exception in thread "main" java.lang. NullPointerException at org.eclipse.osgi.internal.baseadaptor.BaseStorageHook.

MapLocationToURLConnection(BaseStorageHook. Java:372) at org.eclipse.osgi.baseadaptor.BaseAdaptor. MapLocationToURLConnection(BaseAdaptor.

Java:185) at org.eclipse.osgi.framework.internal.core. Framework$1. Run(Framework.

Java:835) at java.security. AccessController. DoPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.Framework.

InstallWorker(Framework. Java:888) at org.eclipse.osgi.framework.internal.core.Framework. InstallBundle(Framework.

Java:832) at org.eclipse.osgi.framework.internal.core. BundleContextImpl. InstallBundle(BundleContextImpl.

Java:167) at org.eclipse.osgi.framework.internal.core. BundleContextImpl. InstallBundle(BundleContextImpl.

Java:161) at com.mydemo.bootstrap.Bootstrap. Main(Bootstrap. Java:35) here is the code ... public class Bootstrap { public static void main( String args ) throws BundleException , InterruptedException , MalformedURLException { // Load the framwork factory ServiceLoader loader = ServiceLoader.

Load( FrameworkFactory. Class ); FrameworkFactory factory = ( FrameworkFactory ) loader. Iterator( ).

Next( ); // Create a new instance of the framework Framework framework = factory. NewFramework( null ); try { // Start the framework framework. Start( ); framework.

Init( ); BundleContext bc = framework. GetBundleContext( ); bc. InstallBundle( "file:/c:/Users/kirk/Desktop/plugins/org.equinoxosgi.toast.client.

Emergency_1.0.0.201106290845. Jar" ); } finally { // Stop the framework framework. Stop( ); // Wait for the framework to stop completely framework.

WaitForStop( 3000 ); } } } thanks for any and all help :) eclipse osgi equinox link|improve this question edited Sep 20 '11 at 19:59amarillion2,47911234 asked Jun 29 '11 at 14:24Boltimuss8910 50% accept rate.

I ran into this problem as well, and I found that you don't get this error when using apache felix instead of equinox as the OSGi framework. It's not really an explanation, but switching to felix might be a possible workaround.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions