Community
Participate
Working Groups
I added @OSGiContext to my @Execute method and I get the following exception. @Execute public void execute( @OSGiBundle BundleContext bundleContext, @Named("org.eclipse.e4.examples.di.product.pluginLocation") String pluginLocation, @Optional Logger logger) { !ENTRY org.eclipse.e4.ui.workbench 4 0 2014-02-08 08:18:05.021 !MESSAGE Internal Error !STACK 0 java.lang.IllegalArgumentException at org.eclipse.osgi.internal.framework.BundleContextImpl.removeBundleListener(BundleContextImpl.java:336) at org.eclipse.e4.core.di.internal.extensions.OSGiObjectSupplier.untrack(OSGiObjectSupplier.java:75) at org.eclipse.e4.core.di.internal.extensions.OSGiObjectSupplier.get(OSGiObjectSupplier.java:50) at org.eclipse.e4.core.internal.di.InjectorImpl.resolveArgs(InjectorImpl.java:456) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:239) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:153) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:222) at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:776) at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:668) at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$6(HandledContributionItem.java:652) at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:584) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4423) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3771) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3391) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1122) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1006) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:147) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:166) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) at org.eclipse.equinox.launcher.Main.run(Main.java:1462) at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
(In reply to Paul Webster from comment #0) > !ENTRY org.eclipse.e4.ui.workbench 4 0 2014-02-08 08:18:05.021 > !MESSAGE Internal Error > !STACK 0 > java.lang.IllegalArgumentException > at > org.eclipse.osgi.internal.framework.BundleContextImpl. > removeBundleListener(BundleContextImpl.java:336) > at > org.eclipse.e4.core.di.internal.extensions.OSGiObjectSupplier. > untrack(OSGiObjectSupplier.java:75) In case you were wondering, this is because a null BundleListener is being passed to the BundleContext.removeBundleListener method.
Here's a fix https://git.eclipse.org/r/21917
Thanks Markus PW
Released as http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?id=39d2772b91c00fe6c6d7dbccf135a2fd20bde60b Thanks Markus. PW
In 4.4.0.I20140303-2000 PW