After installing Eclipse Neon and Buildship 2.0, using an existing workspace, the following pops up frequently, at seemingly random moments.
An error has occurred. See error log for more details.
org.eclipse.buildship.ui.view.task.FaultyProjectNode cannot be cast to org.eclipse.buildship.ui.view.task.ProjectNode.
The error log is not useful, just a bunch of Stack Traces telling me the same as the error message.
Can someone explain what this is about?
How did I get “Faulty Project Nodes”, and how do I detect and fix them?
Here ya go. I think the trigger was a genuinely bad project (could not be refreshed), as the popups went away when I deleted this project from Eclipse, but this is the stack trace:
!SESSION 2017-01-17 10:55:54.384 -----------------------------------------------
eclipse.buildId=4.6.2.M20161124-1400
java.version=1.8.0_66
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
This is a continuation of log file C:\Users\SC1478\wsp6\.metadata\.bak_3.log
Created Time: 2017-01-17 12:55:57.059
!ENTRY org.eclipse.e4.ui.workbench 4 0 2017-01-17 12:55:57.059
!MESSAGE
!STACK 0
java.lang.ClassCastException: org.eclipse.buildship.ui.view.task.FaultyProjectNode cannot be cast to org.eclipse.buildship.ui.view.task.ProjectNode
at org.eclipse.buildship.ui.view.task.WorkbenchSelectionListener.selectProjectsInTree(WorkbenchSelectionListener.java:91)
at org.eclipse.buildship.ui.view.task.WorkbenchSelectionListener.selectionChanged(WorkbenchSelectionListener.java:63)
at org.eclipse.buildship.ui.view.task.WorkbenchSelectionListener.selectionChanged(WorkbenchSelectionListener.java:55)
at org.eclipse.ui.internal.e4.compatibility.SelectionService.notifyListeners(SelectionService.java:259)
at org.eclipse.ui.internal.e4.compatibility.SelectionService.handleSelectionChanged(SelectionService.java:108)
at org.eclipse.ui.internal.e4.compatibility.SelectionService.access$0(SelectionService.java:92)
at org.eclipse.ui.internal.e4.compatibility.SelectionService$1.selectionChanged(SelectionService.java:67)
at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$2.run(SelectionAggregator.java:126)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.notifyListeners(SelectionAggregator.java:123)
at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.access$6(SelectionAggregator.java:121)
at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$7$1.run(SelectionAggregator.java:231)
at org.eclipse.e4.core.contexts.RunAndTrack.runExternalCode(RunAndTrack.java:56)
at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$7.changed(SelectionAggregator.java:228)
at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:114)
at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:343)
at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:358)
at org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl.setSelection(SelectionServiceImpl.java:31)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.selectionChanged(CompatibilityPart.java:450)
at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:158)
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.Viewer.fireSelectionChanged(Viewer.java:155)
at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2191)
at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1728)
at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1077)
at org.eclipse.ui.navigator.CommonViewer.setSelection(CommonViewer.java:370)
at org.eclipse.jface.viewers.Viewer.setSelection(Viewer.java:383)
at org.eclipse.jst.jee.ui.internal.navigator.JEE5ContentProvider$1.run(JEE5ContentProvider.java:146)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4211)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3827)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
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:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.buildship.ui.view.task.WorkbenchSelectionListener.selectProjectsInTree(WorkbenchSelectionListener.java:91)
at org.eclipse.buildship.ui.view.task.WorkbenchSelectionListener.selectionChanged(WorkbenchSelectionListener.java:63)
at org.eclipse.buildship.ui.view.task.WorkbenchSelectionListener.selectionChanged(WorkbenchSelectionListener.java:55)
at org.eclipse.ui.internal.e4.compatibility.SelectionService.notifyListeners(SelectionService.java:259)
at org.eclipse.ui.internal.e4.compatibility.SelectionService.notifyListeners(SelectionService.java:192)
at org.eclipse.ui.internal.WorkbenchWindow$WWinPartService.partActivated(WorkbenchWindow.java:3003)
at org.eclipse.ui.internal.WorkbenchPage$14.run(WorkbenchPage.java:4977)
I will be happy to try it, but I am not sure how to build and then apply to Eclipse a version of Buildship built from source, I’ve only ever installed Buildship from the Eclipse Marketplace, or the internal update mechanism. If you supply some instructions, I will try it.
The problem disappeared with 2.0.1.v20170131-2316-s.
However, if I right click in the “Gradle Tasks” window, there is a new menu that appears and freezes Eclipse:
The main thread seems to be stuck in the SWT MacOSX library:
"main" - Thread t@1
java.lang.Thread.State: RUNNABLE
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
at org.eclipse.swt.internal.cocoa.NSMenu.popUpContextMenu(NSMenu.java:77)
at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:267)
at org.eclipse.swt.widgets.Display.runPopups(Display.java:4157)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3699)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
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:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
That’s weird since we changed nothing on that regard. It seems like that’s a bug in SWT. Do you use the latest Eclipse version? Also, can you try with a fresh Eclipse installation?
After upgrading to this version of the plugin and switching to a new Eclipse workspace, I now see that the Eclipse projects for the Gradle subprojects now appear in nested fashion.
I think that I actually like this behavior. Is it new? Or is there some setting that I’ve forgotten about?
The only downside I see is that when I delete the Eclipse project for the top level, all the Eclipse projects beneath if for the subprojects now pop up and must be deleted again.