Aaaaaaaa
Aaaaaaaa

Reputation: 2114

eclipse: Exceptions after I start a plug-in project

I tried that tutorial: Hello, OSGi, Part 1: Bundles for beginners, and after I start it I get the Hello World! message, and a lot of exceptions too:

org.osgi.framework.BundleException: Exception in org.eclipse.datatools.enablement.oda.ws.ui.Activator.start() of bundle org.eclipse.datatools.enablement.oda.ws.ui.
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318)
    at org.eclipse.osgi.container.Module.doStart(Module.java:571)
    at org.eclipse.osgi.container.Module.start(Module.java:439)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
....
Root exception:
org.eclipse.swt.SWTError: Invalid thread access
    at org.eclipse.ui.plugin.AbstractUIPlugin.createImageRegistry(AbstractUIPlugin.java:217)
    at org.eclipse.ui.plugin.AbstractUIPlugin.getImageRegistry(AbstractUIPlugin.java:261)
    at org.eclipse.datatools.enablement.oda.ws.ui.Activator.declareImage(Activator.java:82)
    at org.eclipse.datatools.enablement.oda.ws.ui.Activator.declareImage(Activator.java:77)
    at org.eclipse.datatools.enablement.oda.ws.ui.Activator.declareImages(Activator.java:59)
    at org.eclipse.datatools.enablement.oda.ws.ui.Activator.start(Activator.java:54)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
    at java.security.AccessController.doPrivileged(Native Method)
...
java.lang.IllegalStateException: Workbench has not been created yet.
    at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:93)
    at org.eclipse.debug.internal.ui.DebugUIPreferenceInitializer.setThemeBasedPreferences(DebugUIPreferenceInitializer.java:208)
    at org.eclipse.debug.internal.ui.DebugUIPreferenceInitializer.initializeDefaultPreferences(DebugUIPreferenceInitializer.java:81)
    at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper$1.run(PreferenceServiceRegistryHelper.java:300)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)

an much more. Any idea?

I'm working with Mars.1 on linux.


I tried to uncheck the unneccesary bundles (remained org.apache.felix.gogo.runtime, org.apache.felix.gogo.shell, org.eclipse.equinox.console, org.eclipse.osgi), then I get such messages:

!ENTRY org.eclipse.update.configurator 4 0 2015-11-24 22:20:46.988
!MESSAGE Could not install bundle plugins/org.eclipse.equinox.p2.repository_2.3.100.v20150428-1613.jar   A bundle is already installed with the name "org.eclipse.equinox.p2.repository" and version "2.3.100.v20150428-1613"

!ENTRY org.eclipse.update.configurator 4 0 2015-11-24 22:20:46.995
!MESSAGE Could not install bundle plugins/org.eclipse.datatools.enablement.oracle.ui_1.0.3.v201201131121.jar   A bundle is already installed with the name "org.eclipse.datatools.enablement.oracle.ui" and version "1.0.3.v201201131121"

!ENTRY org.eclipse.update.configurator 4 0 2015-11-24 22:20:46.998
!MESSAGE Could not install bundle plugins/org.eclipse.wst.jsdt.support.firefox_1.0.500.v201402051800.jar   A bundle is already installed with the name "org.eclipse.wst.jsdt.support.firefox" and version "1.0.500.v201402051800"

but after that the same exceptions

Upvotes: 1

Views: 858

Answers (2)

Dorota
Dorota

Reputation: 40

probably it's too late, but I had the same issue with Eclipse Mars.1. What I had to do was: Before first running: Run>Run Configuration> The "Create, manage, and run configurations window will be shown. There you have to pick OSGi Framework from left list and set up configuration: in Workspace check your project, in Target platform you should pick ONLY:

-org.apache.felix.gogo.command
-org.apache.felix.gogo.runtime
-org.apache.felix.gogo.shell
-org.eclipse.equinox.console
-org.eclipse.osgi

Then uncheck "Include optional dependencies..." and check "Add new workspace.." and "Validate bundles.."

Apply and Run. I don't know why, but I tried to set this after first (any few more tries) running and after set up running conf. it didn't work anyway, but I tried do it again and I set up run config. before I run it for the first time and it worked.

I recommend to install Eclipse Luna anyway, because it's working better (as it should).

Upvotes: 2

Jonah Graham
Jonah Graham

Reputation: 7970

Something has gone wrong with your bundle activations. All the errors you have displayed are bundles assuming they are running with a Workbench or SWT UI thread. Neither of those are necessary for a pure OSGi run.

In your launch configuration, check that you don't have the unneeded bundles enabled as your first port of call. e.g. in the "Bundles" tab uncheck everything except your sample plug-in and the OSGi bundle org.eclipse.osgi.

In particular, the org.eclipse.ui bundles and similar ones you don't want.

In addition, make sure you are using the OSGi Framework launch configuration type and not the Eclipse Application one.

Upvotes: 1

Related Questions