I met this problem when I had Emmet extra feature installed in Eclipse PDT (Zend Eclipse PDT, PDT 3.2.0 w/Eclipse Indigo)
Scenario:
Install Emmet extra feature in Eclipse PDT
Restart Eclipse PDT.
Create a PHP/ZF project.
Open .project file.
Result:
You get in a dialog:
"
An error has occurred. See error log for more details.
org.eclipse.swt.widgets.Composite cannot be cast to org.eclipse.ui.IEditorPart
"
Error log says:
!ENTRY org.eclipse.ui.workbench 4 2 2013-07-19 23:37:31.097
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.ClassCastException: org.eclipse.swt.widgets.Composite cannot be cast to org.eclipse.ui.IEditorPart
at io.emmet.eclipse.EclipseEmmetHelper.getTextEditor(EclipseEmmetHelper.java:53)
at io.emmet.eclipse.TabKeyHandler.install(TabKeyHandler.java:44)
at io.emmet.eclipse.TabKeyHandler$2.partActivated(TabKeyHandler.java:227)
at org.eclipse.ui.internal.PartListenerList$1.run(PartListenerList.java:72)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at org.eclipse.ui.internal.PartListenerList.fireEvent(PartListenerList.java:57)
at org.eclipse.ui.internal.PartListenerList.firePartActivated(PartListenerList.java:70)
at org.eclipse.ui.internal.PartService.firePartActivated(PartService.java:187)
at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:306)
at org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:57)
at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:136)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3649)
at org.eclipse.ui.internal.WorkbenchPage.internalActivate(WorkbenchPage.java:700)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:672)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2970)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2863)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2855)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2806)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2802)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2786)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2777)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:655)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:614)
at org.eclipse.dltk.internal.ui.editor.EditorUtility.openInEditor(EditorUtility.java:399)
at org.eclipse.dltk.internal.ui.editor.EditorUtility.openInEditor(EditorUtility.java:157)
at org.eclipse.php.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:54)
at org.eclipse.php.internal.ui.actions.OpenAction.run(OpenAction.java:179)
at org.eclipse.php.internal.ui.actions.OpenAction.run(OpenAction.java:151)
at org.eclipse.php.internal.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:190)
at org.eclipse.php.internal.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:168)
at org.eclipse.php.internal.ui.actions.PHPExplorerActionGroup.handleOpen(PHPExplorerActionGroup.java:171)
at org.eclipse.dltk.internal.ui.scriptview.ScriptExplorerPart$4.open(ScriptExplorerPart.java:678)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3562)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3186)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
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.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
I met this problem when I had Emmet extra feature installed in Eclipse PDT (Zend Eclipse PDT, PDT 3.2.0 w/Eclipse Indigo)
Scenario: Install Emmet extra feature in Eclipse PDT Restart Eclipse PDT. Create a PHP/ZF project. Open .project file.
Result: You get in a dialog: " An error has occurred. See error log for more details. org.eclipse.swt.widgets.Composite cannot be cast to org.eclipse.ui.IEditorPart "
Error log says:
!ENTRY org.eclipse.ui.workbench 4 2 2013-07-19 23:37:31.097 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". !STACK 0 java.lang.ClassCastException: org.eclipse.swt.widgets.Composite cannot be cast to org.eclipse.ui.IEditorPart at io.emmet.eclipse.EclipseEmmetHelper.getTextEditor(EclipseEmmetHelper.java:53) at io.emmet.eclipse.TabKeyHandler.install(TabKeyHandler.java:44) at io.emmet.eclipse.TabKeyHandler$2.partActivated(TabKeyHandler.java:227) at org.eclipse.ui.internal.PartListenerList$1.run(PartListenerList.java:72) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.runtime.Platform.run(Platform.java:857) at org.eclipse.ui.internal.PartListenerList.fireEvent(PartListenerList.java:57) at org.eclipse.ui.internal.PartListenerList.firePartActivated(PartListenerList.java:70) at org.eclipse.ui.internal.PartService.firePartActivated(PartService.java:187) at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:306) at org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:57) at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:136) at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3649) at org.eclipse.ui.internal.WorkbenchPage.internalActivate(WorkbenchPage.java:700) at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:672) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2970) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2863) at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2855) at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2806) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2802) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2786) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2777) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:655) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:614) at org.eclipse.dltk.internal.ui.editor.EditorUtility.openInEditor(EditorUtility.java:399) at org.eclipse.dltk.internal.ui.editor.EditorUtility.openInEditor(EditorUtility.java:157) at org.eclipse.php.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:54) at org.eclipse.php.internal.ui.actions.OpenAction.run(OpenAction.java:179) at org.eclipse.php.internal.ui.actions.OpenAction.run(OpenAction.java:151) at org.eclipse.php.internal.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:190) at org.eclipse.php.internal.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:168) at org.eclipse.php.internal.ui.actions.PHPExplorerActionGroup.handleOpen(PHPExplorerActionGroup.java:171) at org.eclipse.dltk.internal.ui.scriptview.ScriptExplorerPart$4.open(ScriptExplorerPart.java:678) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152) at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275) at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3562) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3186) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:679) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) 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.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.