[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] How to use launcher.jar in 3.3.0-M7?

I noticed that Equinox 3.3.0-M7 includes the "launcher" JAR
org.eclipse.equinox.launcher, and I decided to see if I could make use
of it. At present, I'm starting Equinox from within my Java program
via EclipseStarter. Is the launcher JAR supposed to provide similar or
better functionality?

I noticed that if I just call

  java -jar org.eclipse.equinox.launcher_1.0.0.v20070502.jar

or try to start it up in the debugger using
org.eclipse.osgi.framework.launcher as the main class, initialization
fails because none of the locations get initialized properly:

,----
| Unable to create FrameworkAdaptor.
| java.lang.reflect.InvocationTargetException
| 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
| 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
| 	at org.eclipse.osgi.framework.launcher.Launcher.doAdaptor(Launcher.java:305)
| 	at org.eclipse.osgi.framework.launcher.Launcher.doIt(Launcher.java:131)
| 	at org.eclipse.osgi.framework.launcher.Launcher.main(Launcher.java:107)
| Caused by: java.lang.NullPointerException
| 	at org.eclipse.core.runtime.adaptor.LocationManager.getOSGiConfigurationDir(LocationManager.java:334)
| 	at org.eclipse.core.runtime.adaptor.LocationManager.getConfigurationFile(LocationManager.java:343)
| 	at org.eclipse.core.runtime.adaptor.LocationManager.initializeDerivedConfigurationLocations(LocationManager.java:171)
| 	at org.eclipse.core.runtime.adaptor.LocationManager.initializeLocations(LocationManager.java:131)
| 	at org.eclipse.osgi.baseadaptor.BaseAdaptor.<init>(BaseAdaptor.java:95)
| 	... 7 more
`----

In LocationManager.getOSGiConfigurationDir(), the variable
configurationLocation is not itself null, but its URL is.

What seems to be missing is the kind of initialization done in
EclipseStarter's initializeProperties() method, where properties
PROP_FRAMEWORK and PROP_INSTALL_AREA are assigned values derived from
figuring out where the org.eclipse.osgi bundle is sitting on disk.

Is Launcher meant to be called from user code, or is something
supposed to have run first that sets up all these properties or
locations in preparation?

-- 
Steven E. Harris