java.lang.ClassCastException: org.eclipse.jdt.internal.core.JavaProject cannot be cast to org.eclipse.core.resources.IResource

Appcelerator JIRA | Chris Williams | 6 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    {html}<div><p>I keep seeing error dialogs popping up when working with Java code in a dev instance of Eclipse. Here's the stacktrace:</p> <pre> <code>!ENTRY org.eclipse.ui 4 0 2011-06-06 14:30:25.009 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.ClassCastException: org.eclipse.jdt.internal.core.JavaProject cannot be cast to org.eclipse.core.resources.IResource at com.aptana.deploy.internal.ProjectPropertyTester.test(ProjectPropertyTester.java:33) at org.eclipse.core.internal.expressions.Property.test(Property.java:58) at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53) at org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:150) at org.eclipse.ui.internal.services.EvaluationResultCache.evaluate(EvaluationResultCache.java:74) at org.eclipse.ui.internal.services.ExpressionAuthority.evaluate(ExpressionAuthority.java:165) at org.eclipse.ui.internal.services.EvaluationAuthority.refsWithSameExpression(EvaluationAuthority.java:153) at org.eclipse.ui.internal.services.EvaluationAuthority.sourceChanged(EvaluationAuthority.java:129) at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:311) 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:401) at org.eclipse.ui.internal.ShowInMenu.fillMenu(ShowInMenu.java:175) at org.eclipse.ui.internal.ShowInMenu.fill(ShowInMenu.java:125) at org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:741) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:822) at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:474) at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:469) at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:495) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:247) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4125) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1461) at org.eclipse.swt.widgets.Menu.menuWillOpen(Menu.java:805) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5522) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:4876) at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5223) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(NSApplication.java:94) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3604) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) 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:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410)</code> </pre></div>{html}

    Appcelerator JIRA | 6 years ago | Chris Williams
    java.lang.ClassCastException: org.eclipse.jdt.internal.core.JavaProject cannot be cast to org.eclipse.core.resources.IResource
  2. 0

    {html}<div><p>I keep seeing error dialogs popping up when working with Java code in a dev instance of Eclipse. Here's the stacktrace:</p> <pre> <code>!ENTRY org.eclipse.ui 4 0 2011-06-06 14:30:25.009 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.ClassCastException: org.eclipse.jdt.internal.core.JavaProject cannot be cast to org.eclipse.core.resources.IResource at com.aptana.deploy.internal.ProjectPropertyTester.test(ProjectPropertyTester.java:33) at org.eclipse.core.internal.expressions.Property.test(Property.java:58) at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53) at org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:150) at org.eclipse.ui.internal.services.EvaluationResultCache.evaluate(EvaluationResultCache.java:74) at org.eclipse.ui.internal.services.ExpressionAuthority.evaluate(ExpressionAuthority.java:165) at org.eclipse.ui.internal.services.EvaluationAuthority.refsWithSameExpression(EvaluationAuthority.java:153) at org.eclipse.ui.internal.services.EvaluationAuthority.sourceChanged(EvaluationAuthority.java:129) at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:311) 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:401) at org.eclipse.ui.internal.ShowInMenu.fillMenu(ShowInMenu.java:175) at org.eclipse.ui.internal.ShowInMenu.fill(ShowInMenu.java:125) at org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:741) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:822) at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:474) at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:469) at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:495) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:247) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4125) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1461) at org.eclipse.swt.widgets.Menu.menuWillOpen(Menu.java:805) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5522) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:4876) at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5223) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(NSApplication.java:94) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3604) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) 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:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410)</code> </pre></div>{html}

    Appcelerator JIRA | 6 years ago | Chris Williams
    java.lang.ClassCastException: org.eclipse.jdt.internal.core.JavaProject cannot be cast to org.eclipse.core.resources.IResource

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.eclipse.jdt.internal.core.JavaProject cannot be cast to org.eclipse.core.resources.IResource

      at com.aptana.deploy.internal.ProjectPropertyTester.test()
    2. com.aptana.deploy
      ProjectPropertyTester.test
      1. com.aptana.deploy.internal.ProjectPropertyTester.test(ProjectPropertyTester.java:33)
      1 frame
    3. Expression Language
      IterateExpression.evaluate
      1. org.eclipse.core.internal.expressions.Property.test(Property.java:58)
      2. org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99)
      3. org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
      4. org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:150)
      4 frames
    4. Workbench
      ExpressionAuthority.sourceChanged
      1. org.eclipse.ui.internal.services.EvaluationResultCache.evaluate(EvaluationResultCache.java:74)
      2. org.eclipse.ui.internal.services.ExpressionAuthority.evaluate(ExpressionAuthority.java:165)
      3. org.eclipse.ui.internal.services.EvaluationAuthority.refsWithSameExpression(EvaluationAuthority.java:153)
      4. org.eclipse.ui.internal.services.EvaluationAuthority.sourceChanged(EvaluationAuthority.java:129)
      5. org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:311)
      6. org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:290)
      6 frames
    5. Eclipse UI
      AbstractSourceProvider.fireSourceChanged
      1. org.eclipse.ui.AbstractSourceProvider.fireSourceChanged(AbstractSourceProvider.java:99)
      1 frame
    6. Workbench
      WorkbenchSourceProvider.checkActivePart
      1. org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(WorkbenchSourceProvider.java:401)
      1 frame
    7. Eclipse UI
      ShowInMenu.fill
      1. org.eclipse.ui.internal.ShowInMenu.fillMenu(ShowInMenu.java:175)
      2. org.eclipse.ui.internal.ShowInMenu.fill(ShowInMenu.java:125)
      2 frames
    8. JFace
      MenuManager$2.menuShown
      1. org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:741)
      2. org.eclipse.jface.action.MenuManager.update(MenuManager.java:822)
      3. org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:474)
      4. org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:469)
      5. org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:495)
      5 frames
    9. RWT
      Display.windowProc
      1. org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:247)
      2. org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      3. org.eclipse.swt.widgets.Display.sendEvent(Display.java:4125)
      4. org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
      5. org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
      6. org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1461)
      7. org.eclipse.swt.widgets.Menu.menuWillOpen(Menu.java:805)
      8. org.eclipse.swt.widgets.Display.windowProc(Display.java:5522)
      8 frames
    10. org.eclipse.swt
      OS.objc_msgSendSuper
      1. org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
      1 frame
    11. RWT
      Display.applicationProc
      1. org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:4876)
      2. org.eclipse.swt.widgets.Display.applicationProc(Display.java:5223)
      2 frames
    12. org.eclipse.swt
      NSApplication.nextEventMatchingMask
      1. org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
      2. org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(NSApplication.java:94)
      2 frames
    13. RWT
      Display.readAndDispatch
      1. org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3604)
      1 frame
    14. Eclipse UI
      Workbench$7.run
      1. org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
      2. org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
      3. org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
      4. org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
      4 frames
    15. Databinding
      Realm.runWithDefault
      1. org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      1 frame
    16. Eclipse UI
      Workbench.createAndRunWorkbench
      1. org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
      1 frame
    17. Eclipse UI
      PlatformUI.createAndRunWorkbench
      1. org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      1 frame
    18. Eclipse IDE
      IDEApplication.start
      1. org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
      1 frame
    19. Equinox Container
      EclipseAppHandle.run
      1. org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
      1 frame
    20. Eclipse OSGi
      EclipseStarter.run
      1. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
      2. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
      3. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
      4. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
      4 frames
    21. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    22. Equinox
      Main.basicRun
      1. org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
      2. org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
      2 frames