Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » NPE on right click of a diagram in Papyrus diagram editor (On right click of a diagram in Papyrus diagram editor I face a NPE. This is reproduced only after closing and reopening a Papyrus diagram editor and doing a right click on it)
NPE on right click of a diagram in Papyrus diagram editor [message #1665388] Wed, 11 March 2015 07:53 Go to next message
Sumit Israni is currently offline Sumit IsraniFriend
Messages: 1
Registered: March 2015
Junior Member
On right click of a diagram in Papyrus diagram editor I face a NPE. This is reproduced only after closing and reopening a Papyrus diagram editor and doing a right click on it. There is a customized popup menu that comes up after doing the right click. The popup menu is configured as a extension (in the plugin.xml) with an object contribution from org.eclipse.ui.popupMenus plugin.

Could anyone help point out what could be wrong Or is it a bug?
My configuration :-

- Version of Papyrus plugin is 1.0.1
- Eclipse Luna Standard Luna SR1 (4.4.1) Build id: M20140925-0400
- JDK 1.7


 java.lang.NullPointerException
	at org.eclipse.ui.internal.ObjectPluginAction.setActivePart(ObjectPluginAction.java:134)
	at org.eclipse.ui.internal.ObjectActionContributor$1.run(ObjectActionContributor.java:161)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.ObjectActionContributor.contributeObjectActions(ObjectActionContributor.java:165)
	at org.eclipse.ui.internal.ObjectActionContributorManager.contributeObjectActions(ObjectActionContributorManager.java:104)
	at org.eclipse.ui.internal.PopupMenuExtender.addObjectActions(PopupMenuExtender.java:328)
	at org.eclipse.ui.internal.PopupMenuExtender.menuAboutToShow(PopupMenuExtender.java:405)
	at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:352)
	at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:492)
	at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:487)
	at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:519)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:255)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:4963)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4639)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023)
	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:4213)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3755)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	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:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)


Thanks a lot in advance.
Best Regards.
Sumit Israni
Re: NPE on right click of a diagram in Papyrus diagram editor [message #1666054 is a reply to message #1665388] Wed, 11 March 2015 14:16 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1221
Registered: July 2009
Location: Canada
Senior Member

Hi,

By the definition of a RuntimeException, it's a bug. But in which
component is the question.

Looking at line 134 of ObjectPluginAction.java, it appears that either

(a) the 'target' part does not yet have its part-site or has forgotten it, or
(b) the 'target' part's site does not yet know its page or has
forgotten it (less likely)

I don't know what could cause a pop-up menu to operate on a part that
is not yet initialized or has been destroyed, so at first blush this
looks like a bug in Eclipse Platform. But it could also be caused by
something that the Papyrus editor part is doing wrong in its
initialization.

If you can provide steps to reproduce this, then please raise a
bugzilla so that it may be debugged and fixed.

Thanks,

Christian


On 2015-03-11 14:04:01 +0000, Sumit Israni said:

> On right click of a diagram in Papyrus diagram editor I face a NPE.
> This is reproduced only after closing and reopening a Papyrus diagram
> editor and doing a right click on it. There is a customized popup menu
> that comes up after doing the right click. The popup menu is configured
> as a extension (in the plugin.xml) with an object contribution from
> org.eclipse.ui.popupMenus plugin.
>
> Could anyone help point out what could be wrong Or is it a bug? My
> configuration :-
> - Version of Papyrus plugin is 1.0.1
> - Eclipse Luna Standard Luna SR1 (4.4.1) Build id: M20140925-0400
> - JDK 1.7
>
>
> java.lang.NullPointerException
> at
> org.eclipse.ui.internal.ObjectPluginAction.setActivePart(ObjectPluginAction.java:134)
>
> at
> org.eclipse.ui.internal.ObjectActionContributor$1.run(ObjectActionContributor.java:161)
>
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at
> org.eclipse.ui.internal.ObjectActionContributor.contributeObjectActions(ObjectActionContributor.java:165)
>
> at
> org.eclipse.ui.internal.ObjectActionContributorManager.contributeObjectActions(ObjectActionContributorManager.java:104)
>
> at
> org.eclipse.ui.internal.PopupMenuExtender.addObjectActions(PopupMenuExtender.java:328)
>
> at
> org.eclipse.ui.internal.PopupMenuExtender.menuAboutToShow(PopupMenuExtender.java:405)
>
> at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:352)
> at
> org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:492)
>
> at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:487)
> at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:519)
> at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:255)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
> at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:4963)
> at org.eclipse.swt.widgets.Control.windowProc(Control.java:4639)
> at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
> at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626)
> at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075)
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023)
> 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:4213)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3755)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
>
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
>
> at
> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
>
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:601)
> 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:1465)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
>
>
> Thanks a lot in advance.
> Best Regards.
> Sumit Israni
Re: NPE on right click of a diagram in Papyrus diagram editor [message #1666141 is a reply to message #1666054] Wed, 11 March 2015 15:03 Go to previous message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 932
Registered: February 2011
Senior Member
Hi,

That's a different manifestation of Bug 403755 [1], and it is a Papyrus bug (The same exception simply occurs later, with a different trace, but something in Papyrus is not disposed properly)

[1] 403755: NPE in MultiPageEditorSite.getPage()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=403755

Camille


Camille Letavernier
Previous Topic:Building sources - configuring Eclipse
Next Topic:Error exporting Diagram as image
Goto Forum:
  


Current Time: Tue Dec 01 18:41:10 GMT 2020

Powered by FUDForum. Page generated in 0.02584 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top