Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » [NullPointerException],at org.eclipse.ui.internal.menus.WorkbenchMenuService.releaseContributions()
[NullPointerException],at org.eclipse.ui.internal.menus.WorkbenchMenuService.releaseContributions() [message #220669] Fri, 06 March 2009 01:57 Go to next message
Allen Wang is currently offline Allen WangFriend
Messages: 28
Registered: July 2009
Junior Member
Dears,

I developed a multipage editor with both GMF editor and EMF editor
following TopicMap example, and after each time workbench exit, I will
receive NPE as following. My eclipse version is Version: 3.4.1, Build
id: M20080911-1700. You can easily reproduced this exception using
TopicMap example, it also has such a problem.

I searched in newsgroup and found a bug report BUG[173657]
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=173657], it shows the
same problem which I met but have no detailed solutions for this.

Anybody knows how to resolve or avoid this problem? Any suggestion is
welcome, thanks!

java.lang.NullPointerException
at
org.eclipse.ui.internal.menus.WorkbenchMenuService.releaseCo ntributions(WorkbenchMenuService.java:869)
at
org.eclipse.ui.internal.menus.WorkbenchMenuService.releaseCo ntributions(WorkbenchMenuService.java:875)
at
org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchW indow.java:1598)
at
org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchW indow.java:722)
at
org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWi ndow.java:698)
at org.eclipse.ui.internal.WorkbenchWindow$3.run(WorkbenchWindo w.java:814)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindo w.java:812)
at org.eclipse.jface.window.WindowManager.close(WindowManager.j ava:109)
at org.eclipse.ui.internal.Workbench$16.run(Workbench.java:912)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:9 09)
at org.eclipse.ui.internal.Workbench.access$15(Workbench.java:8 38)
at org.eclipse.ui.internal.Workbench$23.run(Workbench.java:1082 )
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.Workbench.close(Workbench.java:1080)
at org.eclipse.ui.internal.Workbench.close(Workbench.java:1052)
at
org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchW indow.java:719)
at
org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWi ndow.java:698)
at org.eclipse.ui.internal.WorkbenchWindow$3.run(WorkbenchWindo w.java:814)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindo w.java:812)
at org.eclipse.jface.window.Window.handleShellCloseEvent(Window .java:741)
at org.eclipse.jface.window.Window$3.shellClosed(Window.java:68 7)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:92)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations. java:307)
at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Decorations.jav a:1643)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3789 )
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.j ava:1576)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528 )
at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2366 )
at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:477)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3877 )
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.j ava:1576)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528 )
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:23 71)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3420)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
at
org.eclipse.ui.internal.views.log.EventDetailsDialog.open(Ev entDetailsDialog.java:170)
at
org.eclipse.ui.internal.views.log.EventDetailsDialogAction.r un(EventDetailsDialogAction.java:98)
at
org.eclipse.ui.internal.views.log.LogView$15.doubleClick(Log View.java:513)
at
org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredV iewer.java:799)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(S tructuredViewer.java:797)
at
org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSel ect(AbstractTreeViewer.java:1419)
at
org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSe lected(StructuredViewer.java:1173)
at
org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEven t(OpenStrategy.java:237)
at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.ja va:234)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:295)

Best Regards,
--
Hexise
Re: [NullPointerException],at org.eclipse.ui.internal.menus.WorkbenchMenuService.releaseContribution [message #221042 is a reply to message #220669] Tue, 10 March 2009 15:53 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello hexise,

I'm not sure if this was a reason of the problem... But try to replace SubActionBarsExt.dispose()
method with following implementation:

public void dispose() {
super.dispose();
myContributor.dispose();
myContributor = null;

if (myToolBarContributionItem != null) {
ICoolBarManager coolBarManager = getTopCoolBarManager();
if (coolBarManager instanceof ContributionManager) {
((ContributionManager) coolBarManager).remove(myToolBarContributionItem);
}
/**
* Disposing all toolBar children explicitly. Default logic (myToolBarContributionItem.dispose())
* invoke items[i].release(false); instead of items[i].dispose() leading
us to the problem with
* some of GMF contributions see SCR: .....
*/
if (myToolBarManager instanceof ToolBarManager) {
ToolBarManager toolBarManager = (ToolBarManager) myToolBarManager;
if (toolBarManager.getControl() != null && !toolBarManager.getControl().isDisposed())
{
ToolItem[] items = toolBarManager.getControl().getItems();
for (int i = 0; i < items.length; i++) {
if (!items[i].isDisposed()) {
items[i].dispose();
}
}
}
}
myToolBarContributionItem.dispose();
myToolBarContributionItem = null;
}

if (myToolBarManager != null) {
myToolBarManager.removeAll();
myToolBarManager = null;
}

myPartListener.dispose();
myPartListener = null;
}

-----------------
Alex Shatalin
Re: [NullPointerException],at org.eclipse.ui.internal.menus.WorkbenchMenuService.releaseContribution [message #221194 is a reply to message #221042] Wed, 11 March 2009 11:00 Go to previous message
Allen Wang is currently offline Allen WangFriend
Messages: 28
Registered: July 2009
Junior Member
It works! Thanks very much, Alex!

Alex Shatalin wrote:
> Hello hexise,
>
> I'm not sure if this was a reason of the problem... But try to replace
> SubActionBarsExt.dispose() method with following implementation:
>
> public void dispose() {
> super.dispose();
> myContributor.dispose();
> myContributor = null;
>
> if (myToolBarContributionItem != null) {
> ICoolBarManager coolBarManager = getTopCoolBarManager();
> if (coolBarManager instanceof ContributionManager) {
> ((ContributionManager)
> coolBarManager).remove(myToolBarContributionItem);
> }
> /**
> * Disposing all toolBar children explicitly. Default logic
> (myToolBarContributionItem.dispose())
> * invoke items[i].release(false); instead of items[i].dispose()
> leading us to the problem with * some of GMF contributions see
> SCR: .....
> */
> if (myToolBarManager instanceof ToolBarManager) {
> ToolBarManager toolBarManager = (ToolBarManager)
> myToolBarManager;
> if (toolBarManager.getControl() != null &&
> !toolBarManager.getControl().isDisposed()) {
> ToolItem[] items = toolBarManager.getControl().getItems();
> for (int i = 0; i < items.length; i++) {
> if (!items[i].isDisposed()) {
> items[i].dispose();
> }
> }
> }
> }
> myToolBarContributionItem.dispose();
> myToolBarContributionItem = null;
> }
>
> if (myToolBarManager != null) {
> myToolBarManager.removeAll();
> myToolBarManager = null;
> }
>
> myPartListener.dispose();
> myPartListener = null;
> }
>
> -----------------
> Alex Shatalin
>
>


--
Hexise
Previous Topic:how to create first topic on canvas in Mindmap example
Next Topic:refer to the diagram element in a constaraint
Goto Forum:
  


Current Time: Tue Apr 16 04:54:52 GMT 2024

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

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

Back to the top