Spring Tool Suite
  1. Spring Tool Suite
  2. STS-1593

STS crashes when ressources for grails plugins are not found (possibly wrong path?)

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Blocker Blocker
    • Resolution: Won't Fix
    • Affects Version/s: 2.5.2.RELEASE
    • Fix Version/s: None
    • Component/s: GRAILS
    • Environment:

      Vista 64bit, JVM 1.6.0_24 64bit, (Grails 1.3.4)

      Description

      After a crash during excution of a grails command, STS wont start anymore. It states: "An error has ocurred. See the log file D:\sts-workspace_ah\.metadata\.log ".

      In this file, I see the follwing related stacktrace:
      !ENTRY org.eclipse.osgi 4 0 2011-02-17 10:26:37.766
      !MESSAGE Application error
      !STACK 1
      java.lang.NoClassDefFoundError: org/eclipse/core/resources/IContainer
      at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:116)
      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:369)
      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:619)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
      Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.core.resources (169).
      at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:121)
      at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)
      at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
      at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
      at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:466)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
      at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      ... 14 more
      Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.core.resources.ResourcesPlugin.start() of bundle org.eclipse.core.resources.
      at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
      at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
      at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
      at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)
      at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)
      at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)
      ... 23 more
      Caused by: org.eclipse.core.internal.dtree.ObjectNotFoundException: Tree element '/Prosquare2/yui-2.7.0.1-src-groovy/org/codehaus/groovy/grails/plugins/yui/Yui.groovy' not found.
      at org.eclipse.core.internal.dtree.AbstractDataTree.handleNotFound(AbstractDataTree.java:257)
      at org.eclipse.core.internal.dtree.DeltaDataTree.getData(DeltaDataTree.java:585)
      at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:50)
      at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:47)
      at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:47)
      at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:47)
      at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:47)
      at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:47)
      at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:47)
      at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:47)
      at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:47)
      at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:47)
      at org.eclipse.core.internal.dtree.DeltaDataTree.asBackwardDelta(DeltaDataTree.java:88)
      at org.eclipse.core.internal.dtree.DeltaDataTree.reroot(DeltaDataTree.java:816)
      at org.eclipse.core.internal.dtree.DeltaDataTree.reroot(DeltaDataTree.java:815)
      at org.eclipse.core.internal.dtree.DeltaDataTree.reroot(DeltaDataTree.java:815)
      at org.eclipse.core.internal.dtree.DeltaDataTree.reroot(DeltaDataTree.java:815)
      at org.eclipse.core.internal.dtree.DeltaDataTree.reroot(DeltaDataTree.java:815)
      at org.eclipse.core.internal.dtree.DeltaDataTree.reroot(DeltaDataTree.java:815)
      at org.eclipse.core.internal.dtree.DeltaDataTree.reroot(DeltaDataTree.java:792)
      at org.eclipse.core.internal.watson.ElementTree.immutable(ElementTree.java:517)
      at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:688)
      at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1503)
      at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2134)
      at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:1883)
      at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:406)
      at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
      ... 29 more

      I think the path is set wrong, since in .classpath we have:
      <classpathentry kind="src" path="yui-2.7.0.1-grails-app-i18n">
      <attributes>
      <attribute name="com.springsource.sts.grails.core.SOURCE_FOLDER" value="true"/>
      </attributes>
      </classpathentry>

      So either the folder is incorrectly set to: /Prosquare2/yui-2.7.0.1-src-groovy/org/codehaus/groovy/grails/plugins/yui/Yui.groovy
      instead of: \Prosquare2\plugins\yui-2.7.0.1\src\groovy\org\codehaus\groovy\grails\plugins\yui\Yui.groovy (I don't mean the slashes.)
      or some other ressource path is set incorrectly.

      But this should not cause STS starts to fail! It seems purely project related has nothing to do with eclipse, grails tooling etc., so only a warning should be issued.

        Activity

        Hide
        Andrew Eisenberg (c) added a comment -

        We did change the way that grails plugin source folders are represented internally. Are you using the dev snapshot of the grails tooling?

        I wonder if you are coming across this problem:
        https://bugs.eclipse.org/bugs/show_bug.cgi?id=149121

        You are right that having an invalid path should not cause STS/Eclipse to fail during startup.

        There are several things that I would recommend:

        1. Start STS with the -clean option STS.exe -clean. This will clean out all cached configuration data.
        2. If that doesn't work, make a copy of your project, and delete the original from the file system. Try restarting. And then re-importing
        3. If that still doesn't work, go to your workspace/.metadata/.plugins/org.eclipse.core.resources/.project and delete the folder with the same name as your project (but make a backup first).
        4. If that still doesn't work, restart STS with a new workspace and start over by importing over all of your old projects.

        Please let me know if any of this helps you and we are going to look deeper into the root cause of this issue.

        Show
        Andrew Eisenberg (c) added a comment - We did change the way that grails plugin source folders are represented internally. Are you using the dev snapshot of the grails tooling? I wonder if you are coming across this problem: https://bugs.eclipse.org/bugs/show_bug.cgi?id=149121 You are right that having an invalid path should not cause STS/Eclipse to fail during startup. There are several things that I would recommend: Start STS with the -clean option STS.exe -clean . This will clean out all cached configuration data. If that doesn't work, make a copy of your project, and delete the original from the file system. Try restarting. And then re-importing If that still doesn't work, go to your workspace/.metadata/.plugins/org.eclipse.core.resources/.project and delete the folder with the same name as your project (but make a backup first). If that still doesn't work, restart STS with a new workspace and start over by importing over all of your old projects. Please let me know if any of this helps you and we are going to look deeper into the root cause of this issue.
        Hide
        Adrian Hass added a comment -

        I am using the version that was installed when I selected "Grails Support" in the Dashboard in 2.5.2...

        That was, with the eclipse update and subclipse, the only extension I installed in a new sts installation. (Also new workspace)

        Show
        Adrian Hass added a comment - I am using the version that was installed when I selected "Grails Support" in the Dashboard in 2.5.2... That was, with the eclipse update and subclipse, the only extension I installed in a new sts installation. (Also new workspace)
        Hide
        Andrew Eisenberg (c) added a comment - - edited

        Or, as described in the bugzilla issue above, you could try deleting:

        .metadata/.plugins/org.eclipse.core.resources/.snap

        (but be sure to back it up before deleting just in case)

        I would try this approach first.

        Show
        Andrew Eisenberg (c) added a comment - - edited Or, as described in the bugzilla issue above, you could try deleting: .metadata/.plugins/org.eclipse.core.resources/.snap (but be sure to back it up before deleting just in case) I would try this approach first.
        Hide
        Adrian Hass added a comment -

        Yes, it's the eclipse bug:

        Removing
        [workspaceLocation]\.metadata\.plugins\org.eclipse.core.resources\.snap
        worked.

        But now all my projects are gone in the Project-/Package-Explorer.

        Show
        Adrian Hass added a comment - Yes, it's the eclipse bug: Removing [workspaceLocation] \.metadata\.plugins\org.eclipse.core.resources\.snap worked. But now all my projects are gone in the Project-/Package-Explorer.
        Hide
        Kris De Volder (c) added a comment -

        You should be able to resurrect your projects by doing an "Import existing projects". Point the import wizard to the folder that has all your projects and you should be able to import them all at once.

        Show
        Kris De Volder (c) added a comment - You should be able to resurrect your projects by doing an "Import existing projects". Point the import wizard to the folder that has all your projects and you should be able to import them all at once.
        Hide
        Adrian Hass added a comment -

        Did it, but then I got a "Multiple problems have occurred during: 'Refreshing external folders'"
        Details: java.lang.NullPointerException

        However, the Import seems to have worked...

        Thanks guys, I will keep an eye on the eclipse bug.

        Show
        Adrian Hass added a comment - Did it, but then I got a "Multiple problems have occurred during: 'Refreshing external folders'" Details: java.lang.NullPointerException However, the Import seems to have worked... Thanks guys, I will keep an eye on the eclipse bug.
        Hide
        Kris De Volder (c) added a comment -

        I've also seen that, this is another bug in Eclipse (I'd dig up the bugreport for you but don't have it handy right now). Anyway... I gather you are mostly interested in knowing how to fix it... and I do remember the workaround. Just close and re-open the projects this should clear out some corrupted state that causes this null pointer exception.

        Kris

        Show
        Kris De Volder (c) added a comment - I've also seen that, this is another bug in Eclipse (I'd dig up the bugreport for you but don't have it handy right now). Anyway... I gather you are mostly interested in knowing how to fix it... and I do remember the workaround. Just close and re-open the projects this should clear out some corrupted state that causes this null pointer exception. Kris
        Hide
        Kris De Volder (c) added a comment -

        I'm closing this. There hasn't been any more traffic on this issue in a while and it looks like we were dealing with an Eclipse bug, not an STS bug.

        If there are new developments / problems around this issue that need our attention, feel free to reopen it.

        Show
        Kris De Volder (c) added a comment - I'm closing this. There hasn't been any more traffic on this issue in a while and it looks like we were dealing with an Eclipse bug, not an STS bug. If there are new developments / problems around this issue that need our attention, feel free to reopen it.

          People

          • Assignee:
            Unassigned
            Reporter:
            Adrian Hass
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: