Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359059 - [Commands] [Compatibility] Undefined context error when restarting with a PHP file open
Summary: [Commands] [Compatibility] Undefined context error when restarting with a PHP...
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows XP
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 357666
  Show dependency tree
 
Reported: 2011-09-27 09:33 EDT by Remy Suen CLA
Modified: 2020-05-18 08:03 EDT (History)
6 users (show)

See Also:


Attachments
Log file showing java stack trace. (22.91 KB, text/plain)
2012-07-20 10:36 EDT, Adam Eastbury CLA
no flags Details
workbench.xmi as requested (378.24 KB, text/plain)
2012-07-20 11:08 EDT, Adam Eastbury CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2011-09-27 09:33:49 EDT
Eclipse appears to continue to function.

org.eclipse.core.commands.common.NotDefinedException: Cannot get the parent identifier from an undefined context. org.eclipse.wst.server.ui.internal.webbrowser.actionSet
	at org.eclipse.core.commands.contexts.Context.getParentId(Context.java:201)
	at org.eclipse.jface.bindings.BindingManager.createFilteredContextTreeFor(BindingManager.java:825)
	at org.eclipse.jface.bindings.BindingManager.recomputeBindings(BindingManager.java:1721)
	at org.eclipse.jface.bindings.BindingManager.contextManagerChanged(BindingManager.java:689)
	at org.eclipse.core.commands.contexts.ContextManager.fireContextManagerChanged(ContextManager.java:165)
	at org.eclipse.core.commands.contexts.ContextManager.setActiveContextIds(ContextManager.java:295)
	at org.eclipse.e4.ui.internal.services.ContextContextService.getActiveContextIds(ContextContextService.java:84)
	at org.eclipse.ui.internal.contexts.ContextService.getActiveContextIds(ContextService.java:253)
	at org.eclipse.ui.internal.contexts.ActiveContextSourceProvider.getCurrentState(ActiveContextSourceProvider.java:68)
	at org.eclipse.ui.internal.contexts.ActiveContextSourceProvider.contextManagerChanged(ActiveContextSourceProvider.java:50)
	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.ContextAuthority.sourceChanged(ContextAuthority.java:673)
	at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:310)
	at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:290)
	at org.eclipse.ui.AbstractSourceProvider.fireSourceChanged(AbstractSourceProvider.java:99)
	at org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(WorkbenchSourceProvider.java:407)
	at org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(WorkbenchSourceProvider.java:297)
	at org.eclipse.ui.internal.services.WorkbenchSourceProvider$1.partDeactivated(WorkbenchSourceProvider.java:247)
	at org.eclipse.ui.internal.PartService$4.run(PartService.java:109)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.PartService.partDeactivated(PartService.java:107)
	at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.java:3877)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.WorkbenchPage.firePartDeactivated(WorkbenchPage.java:3875)
	at org.eclipse.ui.internal.WorkbenchPage.access$16(WorkbenchPage.java:3868)
	at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partDeactivated(WorkbenchPage.java:176)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$3.run(PartServiceImpl.java:205)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartDeactivated(PartServiceImpl.java:203)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.setPart(PartServiceImpl.java:159)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:76)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:91)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:326)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:343)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.activate(EclipseContext.java:596)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.activateBranch(EclipseContext.java:601)
	at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.activate(PartActivationHistory.java:52)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:571)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:530)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:105)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.handleEvent(ContributedPartRenderer.java:61)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	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.Shell.setActiveControl(Shell.java:1447)
	at org.eclipse.swt.widgets.Shell.WM_MOUSEACTIVATE(Shell.java:2328)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4572)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1627)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2069)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2528)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2528)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2528)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2528)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2528)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2528)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2528)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2528)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2528)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2427)
	at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1533)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5937)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.PeekMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.PeekMessage(OS.java:3116)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3749)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:970)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:886)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:90)
	at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:559)
Comment 1 Remy Suen CLA 2012-01-11 11:25:27 EST
Cannot reproduce with I20120110-2200 on Windows 7.
Comment 2 James Hamilton CLA 2012-07-15 19:18:40 EDT
Same problem for me on Ubuntu 12.04.

Any time I open a file, or change tabs.
Comment 3 Adam Eastbury CLA 2012-07-20 08:32:14 EDT
The error is repeated a lot (up to 2 minutes of console scrolling worth) of times per action (see observed actions below) which in turn is causing a delay. It occurs regardless of which perspective is open.

Installation details:
Eclipse Juno I20120608-1400.
Windows 2008 Enterprise SP2 x64
Java VM: JDK 1.6.0_14 jvm.dll

Installed software:
Eclipse EGIT 2.0.0.201206130900-r
Eclipse SDK 4.2.0.I20120608-1400
Marketplace Client 1.1.1.I20110907-0947
PHP Development Tools (PDT) SDK Feature 3.0.0.v201201110400-77-184_2BEICRgM_fMVcz0M4Va9O
Subversive Revision Graph (Optional) 1.0.0.I20120601-1700
Subversive SVN Connectors 3.0.0.I20120601-1700
Subversive SVN Integration for the Mylyn Project (Optional) 1.0.0.I20120601-1700
Subversive SVN JDT Ignore Extensions (Optional) 1.0.0.I20120601-1700	
Subversive SVN Team Provider 1.0.0.I20120601-1700
Subversive SVN Team Provider Localization (Optional) 1.0.0.I20120601-1700
Subversive SVN Team Provider Sources 1.0.0.I20120601-1700
SVNKit 1.7.4 Implementation (Optional) 3.0.0.I20120601-1700

Observed actions:
Startup
shutdown
tab focus
tab blur
open file
switch tab
Comment 4 Paul Webster CLA 2012-07-20 10:09:01 EDT
Adam, could you please provide one or two stack traces?

PW
Comment 5 Adam Eastbury CLA 2012-07-20 10:36:49 EDT
Created attachment 218992 [details]
Log file showing java stack trace.

Running eclipse with the -console argument shows the first trace is repeated many many times per action. Only once the trace stops does the action actually get performed.
Comment 6 Paul Webster CLA 2012-07-20 10:59:18 EDT
Thanx Adam.

Could you please attach your <workspace>/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi file?

I believe some process installed the WST server and has since uninstalled it, without cleaning up the actionset.  Now it will complain about it every time contexts are summed up and set.

PW
Comment 7 Adam Eastbury CLA 2012-07-20 11:08:10 EDT
Created attachment 218997 [details]
workbench.xmi as requested

Thank you for looking into this Paul.

As requested, \.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi

Adam
Comment 8 Paul Webster CLA 2012-07-25 08:57:23 EDT
(In reply to comment #7)
> Created attachment 218997 [details]
> workbench.xmi as requested

OK, the root cause is installing something and then uninstalling it.  We're not cleaning up the context as we should.

Adam, as a workaround you can edit the workbench.xmi file and remove this line:
<tags>persp.actionSet:org.eclipse.wst.server.ui.internal.webbrowser.actionSet</tags>

If you do that when eclipse is shut down and then start up eclipse again, it shouldn't complain about that tag any more.

PW
Comment 9 Toshihiro Izumi CLA 2012-07-25 22:18:06 EDT
"undefined context org.eclipse.wst.server.ui.internal.webbrowser.actionSet"
This problem itself is a bug of PDT.
PDT uses org.eclipse.wst.server.ui but it is not being installed when PDT was installed. (bug #384916)

Eclipse 3.x informs the problem when PHP perspective is opened.
>!ENTRY org.eclipse.ui 4 4 2012-07-26 10:38:34.015
>!MESSAGE Unable to find Action Set: org.eclipse.wst.server.ui.internal.webbrowser.actionSet
One time only. No more reports while perspective is opened.

Eclipse 4.x outputs the stacktrace anytime, always. Invalid action set is not ignored. This is the problem on e4, I guess.

org.eclipse.e4.ui.bindings.internal.ContextSet.CComp.getLevel(Context)
>} catch (NotDefinedException e) {
>    // TODO Auto-generated catch block
>    e.printStackTrace();
>}
...not good...

Furthermore, this problem occurs when eclipse starts with PHP perspective. With other perspective such as Resource, there are no exceptions, even when switched to PHP perspective.

Steps to reproduce:
0. Setup eclipse 4.2 (extract zip, start eclipse, create new workspace)
1. Install PHP Development Tools
2. Open PHP perspective
3. Exit eclipse
4. Start eclipsec from command prompt
 * you can see enormous stacktraces
5. Switch to Resource perspective
6. Exit eclipse
7. Start eclipsec from command prompt
 * no error
8. Switch to PHP perspective
 * no error
9. Close PHP perspective
 * no error
10. Open PHP perspective
 * no error

Maybe something wrong in startup sequence.
Comment 10 Adam Eastbury CLA 2012-07-27 03:46:41 EDT
The workaround suggested fails for me as the tag is re-added to the xml file upon existing eclipse. Even with the tag removed the issue still occurs.

I have confirmed the Toshihiro's observation that it does not occur if eclipse starts with the resource perspective and then switch to php.

Adam
Comment 11 Paul Webster CLA 2012-08-10 13:56:25 EDT
(In reply to comment #10)
> The workaround suggested fails for me as the tag is re-added to the xml file
> upon existing eclipse. Even with the tag removed the issue still occurs.

Changing that file only works if eclipse is already shut down, but that's just the work around.  We should emit the message once and disable that actionSet.

PW
Comment 12 Sergey Bushkov CLA 2012-09-25 16:20:16 EDT
Just faced the same problem using custom plugin with perspectiveExtensions. I don't want to open a separate report, since the root cause is probably the same; but I'll add 2 more scenarios here to make sure that perspectiveExtensions are covered:

First, an easy way to reproduce the problem:

- create a simple "hello world" plugin, and add with the following:
  <extension point="org.eclipse.ui.perspectiveExtensions">
    <perspectiveExtension targetID="org.eclipse.ui.resourcePerspective">
      <actionSet id="not.existing.actionset"/>
      ...
    </perspectiveExtension>
  </extension>

- start eclipse, switch to Resource perspective. The single "Unable to find Action Set" error is logged;
- close eclipse while the current perspective is Resource perspective;
- open eclipse - it starts spamming exceptions to console, and becomes very slow..

org.eclipse.core.commands.common.NotDefinedException: Cannot get the parent identifier from an undefined context. not.existing.actionset3
	at org.eclipse.core.commands.contexts.Context.getParentId(Context.java:201)
	at org.eclipse.e4.ui.bindings.internal.ContextSet$CComp.getLevel(ContextSet.java:48)
	at org.eclipse.e4.ui.bindings.internal.ContextSet$CComp.compare(ContextSet.java:38)
	at org.eclipse.e4.ui.bindings.internal.ContextSet$CComp.compare(ContextSet.java:1)
	at java.util.Arrays.mergeSort(Arrays.java:1270)
	at java.util.Arrays.mergeSort(Arrays.java:1281)
	at java.util.Arrays.sort(Arrays.java:1210)
	at java.util.Collections.sort(Collections.java:159)
	at org.eclipse.e4.ui.bindings.internal.ContextSet.<init>(ContextSet.java:76)
	at org.eclipse.e4.ui.bindings.internal.BindingTableManager.createContextSet(BindingTableManager.java:90)
...

- switch back to Java perspective, close eclipse, open eclipse => no spamming. Switch to Resource perspective - a single "Unable to find Action Set" error is logged again.

So, the spamming occures when the perspective with unresolved action set is opened on startup.
Comment 13 Sergey Bushkov CLA 2012-09-25 16:36:10 EDT
The second scenario is worse.

The older version of my plugin was using a perspectiveExtension with actionSet; then I removed the action set itself, and the reference from perspective extension. When the new version of the plugin is installed on top of the old plugin, eclipse starts spamming NotDefinedExceptions.

The workaround is to reset the perspective; but it's not really a solution to ask end user to do it.

The only thing I can do now is to leave an empty action set with the old id, and only remove the references to action set from perspective extensions.
Comment 14 Brian de Alwis CLA 2015-04-10 10:12:11 EDT
Since the last comment is from 2012, is this behaviour still occurring?
Comment 15 Lars Vogel CLA 2020-05-18 08:03:35 EDT
(In reply to Brian de Alwis from comment #14)
> Since the last comment is from 2012, is this behaviour still occurring?

I guess not.