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

Bug 335840

Summary: NotDefinedException when switching the perspective
Product: [RT] RAP Reporter: Ivan Furnadjiev <ivan>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.4   
Target Milestone: 1.4 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Ivan Furnadjiev CLA 2011-01-31 07:59:10 EST
Steps to reproduce:
1. Start Workbench Demo in Firefox for example.
2. Start Workbench Demo again in a different browser (second session), IE for example.
3. Switch the perspective from "Demo" to "Planning" with perspective switcher in the second session (IE).
4. There is an exception in the console:

org.eclipse.core.commands.common.NotDefinedException: Cannot get the parent identifier from an undefined context. org.eclipse.rap.demo.actionSet
	at org.eclipse.core.commands.contexts.Context.getParentId(Context.java:201)
	at org.eclipse.jface.bindings.BindingManager.createFilteredContextTreeFor(BindingManager.java:826)
	at org.eclipse.jface.bindings.BindingManager.recomputeBindings(BindingManager.java:1716)
	at org.eclipse.jface.bindings.BindingManager.contextManagerChanged(BindingManager.java:691)
	at org.eclipse.core.commands.contexts.ContextManager.fireContextManagerChanged(ContextManager.java:165)
	at org.eclipse.core.commands.contexts.ContextManager.setEventCaching(ContextManager.java:324)
	at org.eclipse.core.commands.contexts.ContextManager.deferUpdates(ContextManager.java:83)
	at org.eclipse.ui.internal.contexts.ContextService.deferUpdates(ContextService.java:72)
	at org.eclipse.ui.internal.contexts.SlaveContextService.deferUpdates(SlaveContextService.java:114)
	at org.eclipse.ui.internal.WorkbenchPage$PerspectiveList.updateActionSets(WorkbenchPage.java:4595)
	at org.eclipse.ui.internal.WorkbenchPage$PerspectiveList.setActive(WorkbenchPage.java:4543)
	at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3606)
	at org.eclipse.ui.internal.WorkbenchPage.busySetPerspective(WorkbenchPage.java:1043)
	at org.eclipse.ui.internal.WorkbenchPage.access$16(WorkbenchPage.java:1027)
	at org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.java:3709)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:66)
	at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3707)
	at org.eclipse.ui.handlers.ShowPerspectiveHandler.openPerspective(ShowPerspectiveHandler.java:146)
	at org.eclipse.ui.handlers.ShowPerspectiveHandler.execute(ShowPerspectiveHandler.java:61)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:306)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:167)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:239)
	at org.eclipse.ui.internal.ChangeToPerspectiveMenu.run(ChangeToPerspectiveMenu.java:96)
	at org.eclipse.ui.actions.PerspectiveMenu.run(PerspectiveMenu.java:355)
	at org.eclipse.ui.actions.OpenPerspectiveAction.runWithEvent(OpenPerspectiveAction.java:78)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:575)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:492)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:403)
	at org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatchEvent(UntypedEventAdapter.java:652)
	at org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetSelected(UntypedEventAdapter.java:88)
	at org.eclipse.swt.events.SelectionEvent.dispatchToObserver(SelectionEvent.java:196)
	at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:44)
	at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:163)
	at org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.java:203)
	at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1130)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1120)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2733)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694)
	at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:702)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:685)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
	at org.eclipse.rap.demo.DemoWorkbench.createUI(DemoWorkbench.java:42)
	at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:92)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:242)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:111)
	at java.lang.Thread.run(Thread.java:662)
	at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)
Comment 1 Ivan Furnadjiev CLA 2011-02-01 04:56:35 EST
Created attachment 188034 [details]
Proposed patch

This patch makes ActionSetRegistry to have a session scope.
Comment 2 Ivan Furnadjiev CLA 2011-02-10 08:38:29 EST
Applied patch to CVS HEAD.