problem starting equinox from exported jar [message #547704] |
Mon, 19 July 2010 12:01 |
Eclipse User |
|
|
|
Originally posted by: hillner.informatik.uni-leipzig.de
This is a multi-part message in MIME format.
--------------060006090500010100090408
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Hello,
I have a small program which starts equinox using the EclipseStarter
class so that I can run some plugins in a standalone OSGI platform.
The code:
String[] equinoxArgs = {"-configuration",
"C:/equinox-test/configuration"};
BundleContext context = EclipseStarter.startup(equinoxArgs, null);
for(Bundle b : context.getBundles()) {
if(b.getSymbolicName().equals(bundleName)){
b.start();
}
}
I have org.eclipse.osgi in the classpath to use the EclipseStarter.
Furthermore I use org.eclipse.update.configurator and
org.eclipse.equinox.common to parse the plugins folder, ...
My problem:
-If I run the program inside the eclipse IDE, the starter starts up
equinox and loads all plugins, ... -> everything is fine.
-If I export the program as a runnable jar file and try to run it, the
starter does something but doesn't load the plugins, ... -> log file is
attached.
So, does anyone have an idea what could be wrong there?
--------------060006090500010100090408
Content-Type: text/plain;
name="1279539251921.log"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="1279539251921.log"
!SESSION 2010-07-19 13:34:12.093 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -configuration C:/equinox-test/configuration
!ENTRY org.eclipse.osgi 4 0 2010-07-19 13:34:12.093
!MESSAGE An unexpected runtime error has occurred.
!STACK 0
java.lang.NullPointerException
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.checkSyste mState(BaseStorage.java:709)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.getStateMa nager(BaseStorage.java:699)
at org.eclipse.osgi.baseadaptor.BaseAdaptor.getState(BaseAdapto r.java:390)
at org.eclipse.core.runtime.adaptor.EclipseStarter$1.bundleChan ged(EclipseStarter.java:307)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.d ispatchEvent(BundleContextImpl.java:1234)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEve nt(EventManager.java:211)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEv entSynchronous(ListenerQueue.java:141)
at org.eclipse.osgi.framework.internal.core.Framework.publishBu ndleEventPrivileged(Framework.java:1518)
at org.eclipse.osgi.framework.internal.core.Framework.publishBu ndleEvent(Framework.java:1469)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.d oSetStartLevel(StartLevelManager.java:281)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.l aunch(StartLevelManager.java:247)
at org.eclipse.osgi.framework.internal.core.SystemBundle.resume (SystemBundle.java:201)
at org.eclipse.osgi.framework.internal.core.Framework.launch(Fr amework.java:644)
at org.eclipse.osgi.framework.internal.core.OSGi.launch(OSGi.ja va:51)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(Ecli pseStarter.java:313)
at TEST.main(TEST.java:25)
!ENTRY System Bundle 4 0 2010-07-19 13:34:12.109
!MESSAGE
!STACK 0
java.lang.NullPointerException
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.checkSyste mState(BaseStorage.java:709)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.getStateMa nager(BaseStorage.java:699)
at org.eclipse.osgi.baseadaptor.BaseAdaptor.getState(BaseAdapto r.java:390)
at org.eclipse.core.runtime.adaptor.EclipseStarter$1.bundleChan ged(EclipseStarter.java:307)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.d ispatchEvent(BundleContextImpl.java:1234)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEve nt(EventManager.java:211)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEv entSynchronous(ListenerQueue.java:141)
at org.eclipse.osgi.framework.internal.core.Framework.publishBu ndleEventPrivileged(Framework.java:1518)
at org.eclipse.osgi.framework.internal.core.Framework.publishBu ndleEvent(Framework.java:1469)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.d oSetStartLevel(StartLevelManager.java:281)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.l aunch(StartLevelManager.java:247)
at org.eclipse.osgi.framework.internal.core.SystemBundle.resume (SystemBundle.java:201)
at org.eclipse.osgi.framework.internal.core.Framework.launch(Fr amework.java:644)
at org.eclipse.osgi.framework.internal.core.OSGi.launch(OSGi.ja va:51)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(Ecli pseStarter.java:313)
at TEST.main(TEST.java:25)
--------------060006090500010100090408--
|
|
|
|
Re: problem starting equinox from exported jar [message #547897 is a reply to message #547719] |
Tue, 20 July 2010 06:53 |
Eclipse User |
|
|
|
Originally posted by: hillner.informatik.uni-leipzig.de
Am 7/19/2010 3:35 PM, schrieb Thomas Watson:
> What version of equinox are you using? From the line numbers it looks
> like it could be 3.4. I am not sure what is going wrong at this point.
> Could you try to reproduce on 3.6?
>
> Tom.
Hi Tom,
thanks but I solved the problem. It is not possible to run equinox with
a large set of plugins from a runnable jar. The solution is to export
the classes as a standard java library and add the main class attribute
and the classpath to osgi to the MANIFEST header. Then the framework
comes up without problems.
I'm not sure why this isn't possible with a runnable jar file but the
error message says something about a problem with the storage. So I read
about this here:
http://www.java-forum.org/plattformprogrammierung/85174-equi nox-osgi-eclipsestarter-startup-nullpointerexception.html
Greetings,
Stanley
|
|
|
Powered by
FUDForum. Page generated in 0.04025 seconds