Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-core-dev] Ask for example about starting eclipse's osgi


platform-core-dev-bounces@xxxxxxxxxxx wrote on 10/13/2005 06:39:14 PM:

> hello,
>
> @com.mabo.foo:
> I tried to get the program running and finally find the problem.
> Tough I have a
> further problem with it.
>
> First  to get the FooPlugin running you refer to the org.eclipse.
> core.runtime.jar which
> is on itself a plugin. This must also be installed like BUNDLE_URL.
> For me under linux
> it looks like:


This is right, for your bundles to resolve you must have all your dependencies
installed ...

>
> Now you can try to start() the bundle and your sys.outs will appear.
>
> The issue: If you try to start() the eclipse.core.runtime you will
> get an exception, which is incomprensible to me:
>
> org.osgi.framework.BundleException: Exception in org.eclipse.core.
> internal.runtime.PlatformActivator.start() of bundle org.eclipse.core.runtime.
>    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.
> startActivator(BundleContextImpl.java:1013)
>    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.
> start(BundleContextImpl.java:969)
>    at org.eclipse.osgi.framework.internal.core.BundleHost.
> startWorker(BundleHost.java:321)
>    at org.eclipse.osgi.framework.internal.core.AbstractBundle.
> start(AbstractBundle.java:266)
>    at FooStarter.startBundles(FooStarter.java:154)
>    at FooStarter.start(FooStarter.java:75)
>    at FooStarter.main(FooStarter.java:166)
> Caused by: java.lang.NullPointerException
>    at org.eclipse.core.internal.runtime.InternalPlatform.
> getSplashHandler(InternalPlatform.java:653)
>    at org.eclipse.core.internal.runtime.InternalPlatform.
> start(InternalPlatform.java:1075)
>    at org.eclipse.core.internal.runtime.PlatformActivator.
> startInternalPlatform(PlatformActivator.java:141)
>    at org.eclipse.core.internal.runtime.PlatformActivator.
> start(PlatformActivator.java:57)
>    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.
> run(BundleContextImpl.java:994)
>    at java.security.AccessController.doPrivileged(Native Method)
>    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.
> startActivator(BundleContextImpl.java:988)
>    ... 6 more
>
> Maybe you know why this one comes up.


It appears thier is a bug in in org.eclipse.core.runtime.  It searches
for a service to close the splash screen.  In this case
there is no service available and runtime does not detect this
causing the NPE.  I opened a bug for this against runtime:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=112600

>
> The thing I didn't like in this example program is, that you try to
> call the lower level osgi core, which inhibits me from making use of the
> extension-point-mechanism of the eclipse-runtime. Therefore I tried
> to work with the EclipseStarter.startup(...) to bootstrap the
> eclipse-runtime this way. But I got out with the all-known
> exception, which seems to be a problem with the JVM:
>
>  Exception in thread "main" java.lang.Error: factory already defined
>    at java.net.URL.setURLStreamHandlerFactory(URL.java:1074)
>    at org.eclipse.osgi.framework.internal.core.Framework.
> initialize(Framework.java:184)
>    at org.eclipse.osgi.framework.internal.core.Framework.
> <init>(Framework.java:104)
>    at org.eclipse.osgi.framework.internal.core.OSGi.
> createFramework(OSGi.java:90)
>    at org.eclipse.osgi.framework.internal.core.OSGi.<init>(OSGi.java:31)
>    at org.eclipse.core.runtime.adaptor.EclipseStarter.
> startup(EclipseStarter.java:272)
>    at FooStarter.<init>(FooStarter.java:55)
>    at FooStarter.main(FooStarter.java:165)
>
> Now my question:
> How can I reach a standalone or servlet bootstrapping of the
> eclipse-runtime without getting into troubles??? Does anybody
> has an idea on resolving this problem?
>
> martin

You must be launching eclipse from another java application which already
set the URLStreamHandlerFactory for the VM.  This is a singleton operation.
There is a bug open to investigate how Equinox can better handle this
situation.  Please provide any suggestions and input to this bug.  Simon
Kaegi has already been investigating solutions for this problem.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=107909

Thanks.

Tom.


Back to the top