Announcement Announcement Module
Collapse
No announcement yet.
GSP Files: Could not open the editor: Editor could not be initialized Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • GSP Files: Could not open the editor: Editor could not be initialized

    I have a grails project (from SVN).
    When I try to open a GSP file in STS, I get a red X, with the following message:
    Code:
    Could not open the editor: Editor could not be initialized.
    Clicking on "Details":
    Code:
    java.lang.NullPointerException
    	at com.springsource.sts.grails.editor.groovy.elements.GrailsProject.getCustomTagLibClasses(GrailsProject.java:173)
    	at com.springsource.sts.grails.editor.gsp.tags.GSPModelQueryCMProvider.initializeAllTags(GSPModelQueryCMProvider.java:66)
    	at com.springsource.sts.grails.editor.gsp.tags.GSPModelQueryCMProvider.<init>(GSPModelQueryCMProvider.java:50)
    	at com.springsource.sts.grails.editor.gsp.tags.GSPModelQueryImpl.<init>(GSPModelQueryImpl.java:33)
    	at com.springsource.sts.grails.editor.gsp.tags.ModelQueryAdapterFactoryForGSP.createModelQuery(ModelQueryAdapterFactoryForGSP.java:111)
    	at com.springsource.sts.grails.editor.gsp.tags.ModelQueryAdapterFactoryForGSP.createAdapter(ModelQueryAdapterFactoryForGSP.java:102)
    	at org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory.adaptNew(AbstractAdapterFactory.java:120)
    	at org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory.adapt(AbstractAdapterFactory.java:64)
    	at org.eclipse.wst.sse.core.internal.provisional.AbstractNotifier.getAdapterFor(AbstractNotifier.java:93)
    	at org.eclipse.jst.jsp.core.internal.modelhandler.JSPModelLoader.preLoadAdapt(JSPModelLoader.java:195)
    	at org.eclipse.wst.sse.core.internal.model.AbstractModelLoader.createModel(AbstractModelLoader.java:124)
    	at org.eclipse.wst.sse.core.internal.FileBufferModelManager.getModel(FileBufferModelManager.java:721)
    	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl._getModelFor(ModelManagerImpl.java:658)
    	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.getModelForEdit(ModelManagerImpl.java:1390)
    	at org.eclipse.wst.sse.ui.StructuredTextEditor.doSetInput(StructuredTextEditor.java:1731)
    	at org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:3115)
    	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
    	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
    	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
    	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2579)
    	at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3133)
    	at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3160)
    	at org.eclipse.wst.sse.ui.StructuredTextEditor.init(StructuredTextEditor.java:2321)
    	at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:798)
    	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:644)
    	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462)
    	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    	at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:286)
    	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2857)
    	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2762)
    	at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2754)
    	at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2705)
    	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2701)
    	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2685)
    	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2676)
    	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
    	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
    	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:361)
    	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:168)
    	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:229)
    	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:208)
    	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)
    	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
    	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:373)
    	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:526)
    	at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
    	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:842)
    	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    	at org.eclipse.core.runtime.Platform.run(Platform.java:888)
    	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
    	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:840)
    	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1101)
    	at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1205)
    	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264)
    	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258)
    	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298)
    	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
    	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
    	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
    	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
    	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
    	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
    	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
    	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
    	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
    	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:368)
    	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:559)
    	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
    	at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
    	at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
    Since I started using STS, I've been spending more time debugging STS than debugging my own code.

  • #2
    Can I check what version you are on? You appear to be on something a little old. In the source, line 173 used to (in December) look like this:

    if (root.exists()) {

    but now it looks like this:

    if (root != null && root.exists()) {

    which would fix your NPE.

    You should try to update through the 'Check for updates' eclipse page, but if that doesn't work you may find you are missing this update site: http://www.springsource.com/snapshot/e3.5

    Once that is defined, you should see the latest grails version under the Extensions/STS category. I can see: 2.3.1.201002120800

    Andy
    ---
    Andy Clement
    Groovy Eclipse Development

    Comment


    • #3
      SpringSource Tool Suite

      Version: 2.3.0.RELEASE
      Build Id: 200912171331

      I cannot find where to find the version number for Grails extension.

      My update site was
      http://www.springsource.com/snapshot/e3.4
      I changed it to
      http://www.springsource.com/snapshot/e3.5

      I went to Help > Check for Updates
      It responded "There is nothing to update"

      Then I went in "Install New Software", selected SpringSource, went under Extensions/STS. I manually checked the box for Grails, clicked continue, and got this message:
      Cannot complete the request. See the error log for details.
      SpringSource Tool Suite Grails Support will be ignored because it is already installed, and updates are not permitted.


      EDIT:
      I think I found my current version number for grails extension:
      2.3.0.20091271331-release

      Comment


      • #4
        Originally posted by nasht00 View Post
        SpringSource Tool Suite

        Version: 2.3.0.RELEASE
        Build Id: 200912171331

        I cannot find where to find the version number for Grails extension.
        I find it under Help>About Eclipse Platform then click the SpringSource icon (the two leaves) and it will give you version numbers for STS components. I just installed (on STS 2.3.0) from the extension mechanism and get the same as you (2.3.0.20091271331-release)

        You are on eclipse 3.5 aren't you? (ie. it is an STS 3.5 distribution?). Are you sure it said 'snapshot' and not 'update' as I just made the mistake of confusing those two. At the update version (http://www.springsource.com/update/e3.5) you will find the latest published updates to extensions. But at the snapshot site (http://www.springsource.com/update/e3.5) you will find more recent build artifacts.

        I went to Help > Check for Updates
        It responded "There is nothing to update"

        Then I went in "Install New Software", selected SpringSource, went under Extensions/STS. I manually checked the box for Grails, clicked continue, and got this message:
        Cannot complete the request. See the error log for details.
        SpringSource Tool Suite Grails Support will be ignored because it is already installed, and updates are not permitted.
        I just repeated this whole process - check for updates didn't behave so I went into 'Install New Software' like you. But instead of your issue I get (not much better...)

        Code:
        Your original request has been modified.
          "SpringSource Tool Suite Grails Support" is already installed, so an update will be performed instead.
        Cannot complete the install because one or more required items could not be found.
          Software being installed: SpringSource Tool Suite Grails Support 2.3.1.201002120800-CI-R4655-B119 (com.springsource.sts.grails.feature.group 2.3.1.201002120800-CI-R4655-B119)
          Missing requirement: com.springsource.sts.ide.ui 2.3.1.201002120800-CI-R4655-B119 requires 'bundle org.eclipse.mylyn.commons.core [3.3.2,4.0.0)' but it could not be found
          Cannot satisfy dependency:
            From: SpringSource Tool Suite (required) 2.3.1.201002120800-CI-R4655-B119 (com.springsource.sts.feature.group 2.3.1.201002120800-CI-R4655-B119)
            To: com.springsource.sts.ide.ui [2.3.1.201002120800-CI-R4655-B119]
          Cannot satisfy dependency:
            From: SpringSource Tool Suite Grails Support 2.3.1.201002120800-CI-R4655-B119 (com.springsource.sts.grails.feature.group 2.3.1.201002120800-CI-R4655-B119)
            To: com.springsource.sts.feature.group [2.3.1,2.4.0)
        So then I did a revert to remove what I had installed and then attempted to installed from fresh via 'install new software' and selecting that latest version from there. That doesn't work either.

        I'll talk to the STS team about how we can get you updated to pick up the fix. Sorry this is behaving so badly.

        Andy
        ---
        Andy Clement
        Groovy Eclipse Development

        Comment


        • #5
          I changed the update url to "update" instead of "snapshot", now when looking at available software, the version of grails offered is 2.3.0 and it shows that I already have it installed. (the snapshot version was 2.3.1).

          My Eclipse platform shows as 3.5.1


          I just installed (on STS 2.3.0) from the extension mechanism and get the same as you (2.3.0.20091271331-release)
          So do you mean that I do have the latest "released" version available?

          Confusing ...

          One thing I noticed before is in Dashboard > Extensions, it offers me
          "Grails (current production release)". What is that? Should I try it?

          Comment


          • #6
            I agree it could do with making more clear.

            You have the latest 'released' version available through the extensions mechanism.

            We have nightly builds that are later than what you have, but they don't seem installable for you (or me) right now due to extraneous dependencies. (those are the builds on the snapshot URL).

            The entry 'Grails (current production release)' in the dashboard is Grails itself, not the tools. You probably already have your own copy of grails downloaded elsewhere.

            Andy

            Comment


            • #7
              Hi,

              recent STS nightly snapshots depend on Mylyn weekly builds. Therefore you must add the Mylyn update sites to the update manager to update any STS component.

              Once you added the two following update sites to your update manager, install/update the Grails extension from http://www.springsource.com/snapshot/e3.5 again.

              * http://download.eclipse.org/tools/my...te/weekly/e3.4 (this is also for 3.5)
              * http://download.eclipse.org/tools/my.../weekly/extras

              HTH

              Christian

              Comment

              Working...
              X