Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 138220

Summary: Using 0424-0010, I got org.eclipse.core.commands.common.NotDefinedException
Product: [Eclipse Project] Platform Reporter: Olivier Thomann <Olivier_Thomann>
Component: DebugAssignee: Michael Rennie <Michael_Rennie>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P2 CC: daniel_megert, emoffatt, Mike_Wilson, ob1.eclipse, pwebster, Tod_Creasey
Version: 3.2   
Target Milestone: 3.2 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 135535    

Description Olivier Thomann CLA 2006-04-24 12:49:57 EDT
I got many of these exceptions in the .log file using last night build.

org.eclipse.core.commands.common.NotDefinedException: Cannot get the parent identifier from an undefined context. org.eclipse.pde.ui.JunitLaunchConfig.org.eclipse.debug.ui.DebugPerspective
at org.eclipse.core.commands.contexts.Context.getParentId(Context.java:201)
at org.eclipse.jface.bindings.BindingManager.createFilteredContextTreeFor(BindingManager.java:778)
at org.eclipse.jface.bindings.BindingManager.recomputeBindings(BindingManager.java:1661)
at org.eclipse.jface.bindings.BindingManager.getActiveBindingsByParameterizedCommand(BindingManager.java:890)
at org.eclipse.jface.bindings.BindingManager.getActiveBindingsFor(BindingManager.java:1135)
at org.eclipse.ui.internal.keys.BindingService.getActiveBindingsFor(BindingService.java:128)
at org.eclipse.ui.internal.ide.actions.QuickMenuAction.getShortCutString(QuickMenuAction.java:111)
at org.eclipse.ui.internal.ide.WorkbenchActionBuilder$6.getMenuText(WorkbenchActionBuilder.java:461)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java:728)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java:720)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java:720)
at org.eclipse.ui.internal.Workbench.updateActiveWorkbenchWindowMenuManager(Workbench.java:2518)
at org.eclipse.ui.internal.Workbench.access$0(Workbench.java:2480)
at org.eclipse.ui.internal.Workbench$2.bindingManagerChanged(Workbench.java:2466)
at org.eclipse.jface.bindings.BindingManager.fireBindingManagerChanged(BindingManager.java:846)
at org.eclipse.jface.bindings.BindingManager.setActiveBindings(BindingManager.java:2144)
at org.eclipse.jface.bindings.BindingManager.clearSolution(BindingManager.java:425)
at org.eclipse.jface.bindings.BindingManager.contextManagerChanged(BindingManager.java:642)
at org.eclipse.core.commands.contexts.ContextManager.fireContextManagerChanged(ContextManager.java:120)
at org.eclipse.core.commands.contexts.ContextManager.removeActiveContext(ContextManager.java:200)
at org.eclipse.ui.internal.contexts.ContextAuthority.updateContext(ContextAuthority.java:746)
at org.eclipse.ui.internal.contexts.ContextAuthority.deactivateContext(ContextAuthority.java:350)
at org.eclipse.ui.internal.contexts.ContextService.deactivateContext(ContextService.java:140)
at org.eclipse.debug.internal.ui.contexts.DebugModelContextBindingManager$1.run(DebugModelContextBindingManager.java:336)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
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:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 1 Dani Megert CLA 2006-04-24 13:30:32 EDT
This is one possible cause for bug 135535. Raising severity.
Comment 2 Paul Webster CLA 2006-04-24 15:00:58 EDT
*** Bug 138241 has been marked as a duplicate of this bug. ***
Comment 3 Darin Wright CLA 2006-04-24 16:43:31 EDT
I believe this is a platform UI bug. The debugger creates contexts on the fly to manage view activation in the debugger (combines launch types and perspective). We can create contexts, activate and deactivate them from the IContextService methods #getContext(id) and #activateContext(id) (even if they are undefined). The service allows us to activate undefined contexts, so the platform should be allow for them when computing key bindings.
Comment 4 Darin Wright CLA 2006-04-24 16:44:27 EDT
(NOTE, we have been doing this for a couple months now, so something must have changed in the context manager/key binding code to expose this).
Comment 5 Paul Webster CLA 2006-04-24 17:38:51 EDT
I was planning on disallowing undefined context activations as part of fixing bug 135535.  The fact they currently work is a bug, AFAIK, and they appear to contribute to keybinding problems.

I have protected the BindingManager against undefined contexts for 20060424-0010

You can define the contexts using the Context#define(*) method.

PW
Comment 6 Darin Wright CLA 2006-04-24 18:47:41 EDT
Fixed in PerspectiveManager.
Comment 7 Darin Wright CLA 2006-04-24 18:48:23 EDT
Please verify, Mike.
Comment 8 Michael Rennie CLA 2006-04-25 12:33:18 EDT
verified.