Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320789 - NPE when rendering MenuContribution
Summary: NPE when rendering MenuContribution
Status: RESOLVED DUPLICATE of bug 320235
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-24 04:36 EDT by Reto Urfer CLA
Modified: 2010-07-25 10:52 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Reto Urfer CLA 2010-07-24 04:36:16 EDT
When i try to activate the popup menu on an item in the "Context Menu View" of the SimpleIDE example application i always get the following exception:

!ENTRY org.eclipse.e4.ui.workbench 4 0 2010-07-24 10:28:13.028
!MESSAGE Internal Error
!STACK 0
java.lang.NullPointerException
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledMenuItemRenderer.generateParameterizedCommand(HandledMenuItemRenderer.java:173)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledMenuItemRenderer.createWidget(HandledMenuItemRenderer.java:74)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:612)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:403)
	at org.eclipse.e4.ui.workbench.swt.modeling.MenuServiceFilter.render(MenuServiceFilter.java:235)
	at org.eclipse.e4.ui.workbench.swt.modeling.MenuServiceFilter.showPopup(MenuServiceFilter.java:229)
	at org.eclipse.e4.ui.workbench.swt.modeling.MenuServiceFilter.handleContextMenu(MenuServiceFilter.java:169)
	at org.eclipse.e4.ui.workbench.swt.modeling.MenuServiceFilter.handleEvent(MenuServiceFilter.java:101)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
	at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:4485)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4188)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
	at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method)
	at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:256)
	at org.eclipse.swt.widgets.Display.runPopups(Display.java:4107)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3651)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:713)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:633)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:106)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:124)
	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:369)
	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:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)


This always happens when the MenuContributions defined at the end of the contextViewMenuFragment.e4xmi should be rendered. The item does not contain any command though one has been associated in the model and this one is also defined there.

So it seems that when the model is loaded the commands are not properly associated the the defined MenuContributions.
Comment 1 Paul Webster CLA 2010-07-24 20:24:23 EDT
Which build are you using?  Which build id?

PW
Comment 2 Reto Urfer CLA 2010-07-25 03:34:14 EDT
I am always working with the latest available version, I just updated to BuildId I20100724-2143.
Comment 3 Thomas Schindl CLA 2010-07-25 09:44:09 EDT
Are you by chance running with an old deltas.xml - I think the problem is coming from the fact that we had problems with fragment-contributions and model-reconciler which has been fixed them with bug 320235
Comment 4 Thomas Schindl CLA 2010-07-25 09:44:42 EDT
I could reproduce the problem with old delta but not after cleaning
Comment 5 Reto Urfer CLA 2010-07-25 10:43:23 EDT
yes, this was the problem. after renaming the deltas.xml everything worked fine
Comment 6 Thomas Schindl CLA 2010-07-25 10:52:04 EDT
closeing as a dup

*** This bug has been marked as a duplicate of bug 320235 ***