Community
Participate
Working Groups
Using !SESSION 2011-02-22 14:46:08.405 ----------------------------------------------- eclipse.buildId=I20110210-2002 java.version=1.6.0_24 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=fr_CA Command-line arguments: -os win32 -ws win32 -arch x86_64 -console I got a NPE in the method org.eclipse.e4.ui.workbench.addons.minmax.TrimStack.showStack(..). This caused the UI to be unusable. I had to restart the workspace. I don't have steps to reproduce so far. I was playing with the JUnit view making it a "fast" view using the minimize button. org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException) at org.eclipse.swt.SWT.error(SWT.java:4210) at org.eclipse.swt.SWT.error(SWT.java:4125) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4101) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3718) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:842) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:758) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:87) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:540) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:522) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) Caused by: org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:59) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:226) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:196) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:86) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:251) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:284) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:237) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:504) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:479) at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:105) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$ActivationJob.run(StackRenderer.java:109) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) ... 24 more Caused by: java.lang.NullPointerException at org.eclipse.e4.ui.workbench.addons.minmax.TrimStack.showStack(TrimStack.java:413) at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:52) ... 36 more
Olivier, is this something that works 'most of the time' but failed in this case? I'm just trying to get a handle on how hard this would be to repro...
Making major since it hoses the workbench...
I've just seen this NPE on XP. I don't have a reproducible set of steps either, but my immediate action that repeatedly caused the exception was File > Close All. There were three java editors open at the time, and I had just launched e4, so the editors were open as a consequence of having been left open in the previous session.
To clarify, I saw the same NPE, not the SWTException, so the context was probably different from Olivier's. I'm using e4 M5.
I got a NPE in TrimStack at line 1120 (and I'm not sure if I had to file a new entry or add it here). How to reproduce: 1. Starting point is the E4 application com.example.e4.rcp.todo from Lars Vogels e4 training course. 2. Minimize a part like the Details part. 3. Open the Details part in the "overlay mode" (don't know how to call it, please see the attached screenshot for details). 4. Close the application. 5. -> NPE java.lang.NullPointerException at org.eclipse.e4.ui.workbench.addons.minmax.TrimStack.showStack(TrimStack.java:1120) at org.eclipse.e4.ui.workbench.addons.minmax.TrimStack$10.widgetDisposed(TrimStack.java:618) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:124) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079) I propose to add a null check in line 916 public void showStack(boolean show) { Control ctrl = (Control) minimizedElement.getWidget(); if (ctrl==null){ return; }
Created attachment 273475 [details] How to reproduce the error
New Gerrit change created: https://git.eclipse.org/r/120848
Gerrit change https://git.eclipse.org/r/120848 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=8cf4db4cfa44d355abb32d41e41216d18083adfb
Thanks, Hilger for the contribution and Mickael for the review.