Community
Participate
Working Groups
- open the org.eclipse.ui.tests project and start a runtime workbench => "Show View" dialog shows the "Error handling" category with a few views - close org.eclipse.ui.tests and restart the runtime with the same workspace => "Show View" dialog still shows the "Error handling" category, but the contained views have a red icon, and they naturally fail to open, since the contributing plug-in is gone. The missing icons cause log entries like this: !ENTRY org.eclipse.core.runtime 4 0 2015-07-29 15:58:55.487 !MESSAGE Invalid input url:platform:/plugin/org.eclipse.ui.tests/icons/view.gif !STACK 0 java.io.IOException: Unable to resolve plug-in "platform:/plugin/org.eclipse.ui.tests/icons/view.gif". at org.eclipse.core.internal.runtime.PlatformURLPluginConnection.parse(PlatformURLPluginConnection.java:65) at org.eclipse.core.internal.runtime.FindSupport.find(FindSupport.java:290) at org.eclipse.core.runtime.FileLocator.find(FileLocator.java:152) at org.eclipse.jface.resource.URLImageDescriptor.getFilePath(URLImageDescriptor.java:215) at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:283) at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:224) at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:202) at org.eclipse.ui.internal.dialogs.ViewLabelProvider.getImage(ViewLabelProvider.java:93) at org.eclipse.jface.viewers.ColumnLabelProvider.update(ColumnLabelProvider.java:35) at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:154) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:949) at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:114) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1029) at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:473) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173) at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2176) at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:843) at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:818) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:791) at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:611) at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:762) at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(AbstractTreeViewer.java:1493) at org.eclipse.jface.viewers.TreeViewer.handleTreeExpand(TreeViewer.java:903) at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded(AbstractTreeViewer.java:1505) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:132) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1137) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1122) at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:7633) at org.eclipse.swt.widgets.Control.wmNotify(Control.java:5690) at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:1956) at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:5242) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4718) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2443) at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1553) at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:6501) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4698) at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:6024) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3767) at org.eclipse.jface.window.Window.runEventLoop(Window.java:827) at org.eclipse.jface.window.Window.open(Window.java:803) at org.eclipse.ui.handlers.ShowViewHandler.openOther(ShowViewHandler.java:94) at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:75) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295) at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:493) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486) at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1266) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1112) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1137) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1122) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1164) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1160) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1581) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4781) at org.eclipse.swt.widgets.Tree.WM_CHAR(Tree.java:6028) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4662) at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:6024) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3767) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:157) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at org.eclipse.equinox.launcher.Main.run(Main.java:1515) at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
This looks like a dup of bug 473097, see bug 473097 comment 1 and bug 473097 comment 3.
*** Bug 473097 has been marked as a duplicate of this bug. ***
Simon, looks like Bug 445663 was not sufficient to remove the uninstalled part descriptors from the application model? Can you please have a look?
*** Bug 475628 has been marked as a duplicate of this bug. ***
New Gerrit change created: https://git.eclipse.org/r/55249
This patch saves the bundlesymbolicname and class of the 3.x ViewPart as persisted state on its MPartDescriptor in order use this information to check if the plugin for this ViewPart is available at runtime.
Sorry Simon for the late feedback. I will review early M3.
Gerrit change https://git.eclipse.org/r/55249 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=040baab905f3add0f9007d86b27720330f6044d3
Thanks Simon, looks fine. This fix removes invalid views which are added after this fix, not views which were added before but I also did not find another way to implement this. Everyone who has this situation, needs to start Eclipse once with -clearPersistedState, after this patch invalid views should be removed.
I leave the bug open for a potential backport.
(In reply to Lars Vogel from comment #10) > I leave the bug open for a potential backport. +1 for backport from additional committer and project lead
Unfortunately the check triggers bundles activation, which is undesired.
(In reply to Lars Vogel from comment #11) > (In reply to Lars Vogel from comment #10) > > I leave the bug open for a potential backport. > > +1 for backport from additional committer and project lead -1
ModelCleanupAddon tests of a class is still present by loading it, this triggers activation of the plugins which are configured to be started lazy. private Class<?> findClass(String className, BundleWiring wiring) { if (wiring == null) { return null; } if ((wiring.getRevision().getTypes() & BundleRevision.TYPE_FRAGMENT) != 0) { // fragment case; need to get the host wiring wiring = wiring.getRequiredWires(HostNamespace.HOST_NAMESPACE).get(0).getProviderWiring(); } try { return wiring.getClassLoader().loadClass(className); } catch (ClassNotFoundException e) { return null; } } Simon, can you please provide a revert of this fix, so that we can investigate a better solution to check for the presence of a class?
New Gerrit change created: https://git.eclipse.org/r/57603
Gerrit change https://git.eclipse.org/r/57603 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=78b70ded41595fe72eb07d61d30ec38d08187f42
(In reply to Eclipse Genie from comment #16) > Gerrit change https://git.eclipse.org/r/57603 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=78b70ded41595fe72eb07d61d30ec38d08187f42 Reverted the fix, Simon will check with Equinox if there is a way to check for the existing of a class without triggering activation in OSGi.
(In reply to Lars Vogel from comment #17) > (In reply to Eclipse Genie from comment #16) > > Gerrit change https://git.eclipse.org/r/57603 was merged to [master]. > > Commit: > > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > > ?id=78b70ded41595fe72eb07d61d30ec38d08187f42 > > Reverted the fix, Simon will check with Equinox if there is a way to check > for the existing of a class without triggering activation in OSGi. Thank you! I verified it in my workspace that the test now passes again.
(In reply to Lars Vogel from comment #17) > (In reply to Eclipse Genie from comment #16) > > Gerrit change https://git.eclipse.org/r/57603 was merged to [master]. > > Commit: > > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > > ?id=78b70ded41595fe72eb07d61d30ec38d08187f42 > > Reverted the fix, Simon will check with Equinox if there is a way to check > for the existing of a class without triggering activation in OSGi. Sorry I was trying to submit a change to gerrit and I somehow pushed it directly to master: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=3351720b8d7805492868333932e7ed90fca0b37d The scary thing is I did NOT think I was a committer to platform.ui. I obviously am, otherwise I would have expected my push to master to fail ... or else there is a serious hole in our git committer check on the server. I probably should revert, but instead could someone have a look at my change?
(In reply to Thomas Watson from comment #19) > Sorry I was trying to submit a change to gerrit and I somehow pushed it > directly to master: > > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=3351720b8d7805492868333932e7ed90fca0b37d > > > The scary thing is I did NOT think I was a committer to platform.ui. I > obviously am, otherwise I would have expected my push to master to fail ... > or else there is a serious hole in our git committer check on the server. You are a committer. I think that happened when we folded some components into Platform UI. > I probably should revert, but instead could someone have a look at my change? With this fix most view descriptors are considered invalid and get removed. The IDE is unusable. However, I'm not 100% sure it is your new code or rather a bug in ModelCleanupAddon.isValidPartDescriptor(Bundle, MPartDescriptor). I've reverted the fix with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=e0cf683becc868b01b43aad83d21cb64843307b1
(In reply to Dani Megert from comment #20) > With this fix most view descriptors are considered invalid and get removed. > The IDE is unusable. However, I'm not 100% sure it is your new code or > rather a bug in ModelCleanupAddon.isValidPartDescriptor(Bundle, > MPartDescriptor). This was when starting tests or a new workspace from my IDE. It looks like the problem does not happen when using the clean N20151007-2000 build itself.
New Gerrit change created: https://git.eclipse.org/r/57709
I've uploaded a new patch, which combines Thomas Watson's and my latest changes. Unfortunately the classes are not found, even they should be available. The checkClassResource method also return false in case the desired class is available. Therefore I gave -1 for the patch, but at least it may be tested with the latest changes.
(In reply to Dani Megert from comment #21) > (In reply to Dani Megert from comment #20) > > With this fix most view descriptors are considered invalid and get removed. > > The IDE is unusable. However, I'm not 100% sure it is your new code or > > rather a bug in ModelCleanupAddon.isValidPartDescriptor(Bundle, > > MPartDescriptor). > > This was when starting tests or a new workspace from my IDE. It looks like > the problem does not happen when using the clean N20151007-2000 build itself. Additional hint: in my workspace most of the stuff is in source. That might explain the different results.
I rebased and modified the gerrit review at: https://git.eclipse.org/r/#/c/57709/2 I made a very dumb mistake by calling BundleWiring.findEntries instead of BundleWiring.listResources. The findEntries method only looks in the local bundle file and attached fragments for the resource. The listResources searches the bundles dependencies (Import-Package, Require-Bundle and its local classpath as specified by Bundle-ClassPath header). Basically identical to the search done to find and load a Class. That explains why Dani saw lots of errors when having most of the source loaded in the workspace. There 'bin' is added to the classpath and the root of the bundle file is the project so searching for .class files from the root of the project with findEntries will mostly not work. The use findEntries of also was failing when a bundle was contributing a class from some dependency
(In reply to Markus Keller -- away till Oct 13 from comment #0) > - open the org.eclipse.ui.tests project and start a runtime workbench > => "Show View" dialog shows the "Error handling" category with a few views > > - close org.eclipse.ui.tests and restart the runtime with the same workspace > => "Show View" dialog still shows the "Error handling" category, but the > contained views have a red icon, and they naturally fail to open, since the > contributing plug-in is gone. > I just tried the latest change https://git.eclipse.org/r/#/c/57709/2 and followed the steps above and it works fine for me. One view('org.eclipse.ui.tests.api.workbenchpart.ViewWithMissingClass') without class reference from the org.eclipse.ui.tests plugin is removed by the ModelCleanupAddon and logs this message: !ENTRY org.eclipse.e4.ui.workbench 2 0 2015-10-08 16:34:08.451 !MESSAGE Removing part descriptor with the 'org.eclipse.ui.tests.api.workbenchpart.ViewWithMissingClass' id and the 'ERROR: View pointing to invalid class' description. Points to the invalid 'bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView' class. I hope this removal does not cause any undesired side effects.
Simon, did you check if the Plugins from Dani's comment get activated? They should not. You can use the bundle spy to see their state.
(In reply to Lars Vogel from comment #27) > Simon, did you check if the Plugins from Dani's comment get activated? They > should not. You can use the bundle spy to see their state. Ups, sorry I just noticed that Dani placed that information into the wrong bug. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=478333#c26 for details. This is the list for plug-ins: junit.framework.AssertionFailedError: Wrong bundles loaded: - org.eclipse.ant.ui - org.eclipse.debug.ui - org.eclipse.help.base - org.eclipse.help.ui - org.eclipse.jdt.debug - org.eclipse.jdt.debug.ui - org.eclipse.jdt.junit - org.eclipse.pde.runtime - org.eclipse.search - org.eclipse.team.cvs.ui - org.eclipse.ui.cheatsheets - org.eclipse.ui.console - org.eclipse.ui.browser
(In reply to Lars Vogel from comment #28) > (In reply to Lars Vogel from comment #27) > > Simon, did you check if the Plugins from Dani's comment get activated? They > > should not. You can use the bundle spy to see their state. Or simply run org.eclipse.jdt.text.tests.PluginsNotLoadedTest.testPluginsNotLoaded from 'org.eclipse.jdt.text.tests'. The other check is to make sure that things still work (see comment 20).
The org.eclipse.jdt.text.tests.PluginsNotLoadedTest.testPluginsNotLoaded test from 'org.eclipse.jdt.text.tests' passes properly now. I also checked this with the osgi console and the bundle spy. So it seems to be fine from this side. Concerning the actual patch I checked if it works for e3 parts from the org.eclipse.ui.tests project, as well as with e4 parts, which are provided by the e4 tools. So on this side everything seems to be fine either. The IDE now only complains about missing handler implementations, like already did before, which I want to tackle next, once this patch is merged and verified.
Gerrit change https://git.eclipse.org/r/57709 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=172fa0ab28e34ea3d35b094198433abf66700b7e
.
*** Bug 480206 has been marked as a duplicate of this bug. ***
The fix for this bug has not been backported to 4.5.2 yet.
(In reply to Kalyan Prasad Tatavarthi from comment #34) > The fix for this bug has not been backported to 4.5.2 yet. ==> reopening
(In reply to Kalyan Prasad Tatavarthi from comment #34) > The fix for this bug has not been backported to 4.5.2 yet. We need additional committers to give +1 for the backport.
Too late for 4.5.2.