| Summary: | [Commands] [Compatibility] Undefined context error when restarting with a PHP file open | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Remy Suen <remy.suen> | ||||||
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> | ||||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | eclipse, Lars.Vogel, mrjameshamilton, pwebster, sbushkov, thatnitind | ||||||
| Version: | 4.2 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 357666 | ||||||||
| Attachments: |
|
||||||||
|
Description
Remy Suen
Cannot reproduce with I20120110-2200 on Windows 7. Same problem for me on Ubuntu 12.04. Any time I open a file, or change tabs. 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 Adam, could you please provide one or two stack traces? PW 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.
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 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
(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 "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. 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 (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 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.
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. Since the last comment is from 2012, is this behaviour still occurring? (In reply to Brian de Alwis from comment #14) > Since the last comment is from 2012, is this behaviour still occurring? I guess not. |