Community
Participate
Working Groups
Ran into this while testing one of my RCPs (https://github.com/ifedorenko/p2-browser) with recently released eclipse sdk 4.2M2. Launching the RCP directly from workbench results in "Internal Error" popup and exception below in the log. !ENTRY org.eclipse.e4.ui.workbench 4 0 2011-09-26 17:42:05.165 !MESSAGE Internal Error !STACK 0 org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:838) at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:110) at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:80) at org.eclipse.e4.core.contexts.ContextInjectionFactory.inject(ContextInjectionFactory.java:72) at org.eclipse.ui.internal.Workbench.createWorkbenchWindow(Workbench.java:1207) at org.eclipse.ui.internal.Workbench.getActiveWorkbenchWindow(Workbench.java:1181) at org.eclipse.ui.internal.services.WorkbenchSourceProvider.updateActiveShell(WorkbenchSourceProvider.java:932) at org.eclipse.ui.internal.services.WorkbenchSourceProvider.getCurrentState(WorkbenchSourceProvider.java:133) at org.eclipse.ui.internal.services.WorkbenchSourceProvider$6.handleEvent(WorkbenchSourceProvider.java:692) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1069) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4127) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1461) at org.eclipse.swt.widgets.Shell.windowDidBecomeKey(Shell.java:2102) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5519) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:213) at org.eclipse.swt.widgets.Widget.becomeKeyWindow(Widget.java:361) at org.eclipse.swt.widgets.Shell.becomeKeyWindow(Shell.java:533) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5343) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4989) at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5138) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3610) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:970) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:886) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:90) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:559) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:519) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at com.ifedorenko.p2browser.Application.start(Application.java:31) 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:624) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579) at org.eclipse.equinox.launcher.Main.run(Main.java:1431) at org.eclipse.equinox.launcher.Main.main(Main.java:1407) Caused by: java.lang.NullPointerException at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3233) at org.eclipse.ui.internal.WorkbenchWindow.setup(WorkbenchWindow.java:519) 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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56) ... 50 more
Hi Igor, does the NPE go away if you add org.eclipse.equinox.event as a required bundle in your launch configuration? Thank you for testing Eclipse 4.x.
Well, the NPE did go away after I added org.eclipse.equinox.event, however RCP GUI still does not show up. From what I can tell, e4 ignores org.eclipse.ui.perspectiveExtensions. Are there any known problems in e4 I should be aware of? Btw, I also had to add org.eclipse.e4.ui.workbench.addons.swt to my RCP's runtime to get rid of some warnings in the log.
(In reply to comment #2) > From what I can tell, e4 ignores > org.eclipse.ui.perspectiveExtensions. You seem to be using a relative id of 'org.eclipse.ui.editors'. This is not a valid id to use in 3.x. If you step through the code in 3.x, it will actually log a message in the error log. !ENTRY org.eclipse.ui 4 4 2011-09-26 20:17:37.212 !MESSAGE Referenced part does not exist yet: org.eclipse.ui.editors. As you have noticed, the 4.x code is not as forgiving in this regard so we'll have to add back some code to make this incorrect scenario "work". In the meantime, you should change your 'relationship' attribute to something else besides 'stack' or 'fast'. That should get your view to show up, Igor.
(In reply to comment #3) > > In the meantime, you should change your 'relationship' attribute to something > else besides 'stack' or 'fast'. That should get your view to show up, Igor. FYI, I could not make my view show up with perspectiveExtensions but 3 lines of java in IPerspectiveFactory.createInitialLayout did the trick. This is good enough for what I need. Thank you for your help.
(In reply to comment #4) > FYI, I could not make my view show up with perspectiveExtensions Ah, I see the problem now. I forgot the fact that the relative id was non-existent. If you use the snippet below then it should work. Note that the id is not actually org.eclipse.ui.editors but org.eclipse.ui.editorss. You can see the constant defined in IPageLayout.ID_EDITOR_AREA. <view id="com.ifedorenko.p2browser.views.MetadataRepositoryView" minimized="false" relationship="left" relative="org.eclipse.ui.editorss" standalone="true">
Fix pushed to R4_development. http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_development&id=8b97e3bc64474571e976ef2da92c4528e9f47718 Thanks for the bug report, Igor!
(In reply to comment #6) > Fix pushed to R4_development. > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_development&id=8b97e3bc64474571e976ef2da92c4528e9f47718 > > Thanks for the bug report, Igor! Does this address the NPE or only the problem with perspectiveExtensions?
(In reply to comment #7) > Does this address the NPE or only the problem with perspectiveExtensions? The fix addresses the latter.
(In reply to comment #8) > (In reply to comment #7) > > Does this address the NPE or only the problem with perspectiveExtensions? > > The fix addresses the latter. Are there plans to address the NPE?
(In reply to comment #9) > Are there plans to address the NPE? No. The programs's log would be flooded with "Event Admin service is not available" error messages which indicates that the EventAdmin service is missing.
Verified with I20111025-2000 on Windows XP. Thanks for the bug report, Igor!