Announcement Announcement Module
Collapse
No announcement yet.
Cannot open GSP editor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot open GSP editor

    If I try to open a .gsp in the GSP Editor, I get an error. Anyone else seeing this? Using 2.3.0-RELEASE

    Unable to create editor ID com.springsource.sts.grails.editor.gsp.editor: Editor could not be initialized.
    java.lang.NullPointerException
    at com.springsource.sts.grails.editor.groovy.elements .GrailsProject.getCustomTagLibClasses(GrailsProjec t.java:173)
    at com.springsource.sts.grails.editor.gsp.tags.GSPMod elQueryCMProvider.initializeAllTags(GSPModelQueryC MProvider.java:66)
    at com.springsource.sts.grails.editor.gsp.tags.GSPMod elQueryCMProvider.<init>(GSPModelQueryCMProvider.j ava:50)
    at com.springsource.sts.grails.editor.gsp.tags.GSPMod elQueryImpl.<init>(GSPModelQueryImpl.java:33)
    at com.springsource.sts.grails.editor.gsp.tags.ModelQ ueryAdapterFactoryForGSP.createModelQuery(ModelQue ryAdapterFactoryForGSP.java:111)
    at com.springsource.sts.grails.editor.gsp.tags.ModelQ ueryAdapterFactoryForGSP.createAdapter(ModelQueryA dapterFactoryForGSP.java:102)
    at org.eclipse.wst.sse.core.internal.provisional.Abst ractAdapterFactory.adaptNew(AbstractAdapterFactory .java:120)
    at org.eclipse.wst.sse.core.internal.provisional.Abst ractAdapterFactory.adapt(AbstractAdapterFactory.ja va:64)
    at org.eclipse.wst.sse.core.internal.provisional.Abst ractNotifier.getAdapterFor(AbstractNotifier.java:9 3)
    at org.eclipse.jst.jsp.core.internal.modelhandler.JSP ModelLoader.preLoadAdapt(JSPModelLoader.java:195)
    at org.eclipse.wst.sse.core.internal.model.AbstractMo delLoader.createModel(AbstractModelLoader.java:124 )
    at org.eclipse.wst.sse.core.internal.FileBufferModelM anager.getModel(FileBufferModelManager.java:721)
    at org.eclipse.wst.sse.core.internal.model.ModelManag erImpl._getModelFor(ModelManagerImpl.java:658)
    at org.eclipse.wst.sse.core.internal.model.ModelManag erImpl.getModelForEdit(ModelManagerImpl.java:1390)
    at org.eclipse.wst.sse.ui.StructuredTextEditor.doSetI nput(StructuredTextEditor.java:1731)
    at org.eclipse.ui.texteditor.AbstractTextEditor$19.ru n(AbstractTextEditor.java:3115)

    [ snipped ]

  • #2
    I wonder if this problem is caused by what is being talked about in this issue?

    STS-739: Configure source locations for Grails installs
    https://issuetracker.springsource.com/browse/STS-739

    I cannot figure out how to manually configure the source because I do not know where to find it.

    The issue talks about src/java but it looks like it is in src/web. If I change the source attachment for grails-web-1.1.1.jar I can open the source when I expand the JAR, but the editor still gives the same error.

    Comment


    • #3
      Actually, it is the same problem described here:

      http://forum.springsource.org/showpo...15&postcount=1

      I am going to make a fix that will fail gracefully (ie- GSP editor will be opened and a entry will be added to the error log). This should be available for tonight's snapshot build.

      Comment


      • #4
        For me, adding grails-app/taglib to the classpath fixed the problem. I think I might have removed it when I was initially cleaning things up and I thought I might have added it myself.

        Thanks

        Mark

        Comment


        • #5
          Happened to me too

          I recently downloaded STS 2.3.1 and installed the top two grails and groovy exentions.

          When opening a .gsp file I get the error noted above, "Could not open the editor: Editor could not be initialized." Along with a stack trace in details.

          Some google searches suggested updating Groovy. No updates were available.

          I grabbed the optional installations from "Groovy Update Site For Eclipse 3.5 - http://dist.codehaus.org/groovy/dist...snapshot/e3.5/ " to be thorough.

          As for putting grails-app/taglib in the classpath, I tried that and it considered it a duplicate entry, so I took it out.

          Both the gsp and jsp editor hangs with an hour glass cursor. I have to kill the app.

          Thanks for your help!


          java.lang.NullPointerException
          at com.springsource.sts.grails.editor.gsp.tags.GSPMod elQueryCMProvider.<init>(GSPModelQueryCMProvider.j ava:53)
          at com.springsource.sts.grails.editor.gsp.tags.GSPMod elQueryImpl.<init>(GSPModelQueryImpl.java:36)
          at com.springsource.sts.grails.editor.gsp.tags.ModelQ ueryAdapterFactoryForGSP.createModelQuery(ModelQue ryAdapterFactoryForGSP.java:111)
          at com.springsource.sts.grails.editor.gsp.tags.ModelQ ueryAdapterFactoryForGSP.createAdapter(ModelQueryA dapterFactoryForGSP.java:102)
          at org.eclipse.wst.sse.core.internal.provisional.Abst ractAdapterFactory.adaptNew(AbstractAdapterFactory .java:120)
          at org.eclipse.wst.sse.core.internal.provisional.Abst ractAdapterFactory.adapt(AbstractAdapterFactory.ja va:64)
          at org.eclipse.wst.sse.core.internal.provisional.Abst ractNotifier.getAdapterFor(AbstractNotifier.java:9 3)
          at org.eclipse.jst.jsp.core.internal.modelhandler.JSP ModelLoader.preLoadAdapt(JSPModelLoader.java:195)
          at org.eclipse.wst.sse.core.internal.model.AbstractMo delLoader.createModel(AbstractModelLoader.java:124 )
          at org.eclipse.wst.sse.core.internal.FileBufferModelM anager.getModel(FileBufferModelManager.java:721)
          at org.eclipse.wst.sse.core.internal.model.ModelManag erImpl._getModelFor(ModelManagerImpl.java:658)
          at org.eclipse.wst.sse.core.internal.model.ModelManag erImpl.getModelForEdit(ModelManagerImpl.java:1390)
          at org.eclipse.wst.sse.ui.StructuredTextEditor.doSetI nput(StructuredTextEditor.java:1731)
          at org.eclipse.ui.texteditor.AbstractTextEditor$19.ru n(AbstractTextEditor.java:3116)
          at org.eclipse.jface.operation.ModalContext.runInCurr entThread(ModalContext.java:464)
          at org.eclipse.jface.operation.ModalContext.run(Modal Context.java:372)
          at org.eclipse.jface.window.ApplicationWindow$1.run(A pplicationWindow.java:759)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(Bus yIndicator.java:70)
          at org.eclipse.jface.window.ApplicationWindow.run(App licationWindow.java:756)
          at org.eclipse.ui.internal.WorkbenchWindow.run(Workbe nchWindow.java:2579)
          at org.eclipse.ui.texteditor.AbstractTextEditor.inter nalInit(AbstractTextEditor.java:3134)
          at org.eclipse.ui.texteditor.AbstractTextEditor.init( AbstractTextEditor.java:3161)
          at org.eclipse.wst.sse.ui.StructuredTextEditor.init(S tructuredTextEditor.java:2321)
          at org.eclipse.ui.internal.EditorManager.createSite(E ditorManager.java:798)
          at org.eclipse.ui.internal.EditorReference.createPart Helper(EditorReference.java:644)
          at org.eclipse.ui.internal.EditorReference.createPart (EditorReference.java:462)
          at org.eclipse.ui.internal.WorkbenchPartReference.get Part(WorkbenchPartReference.java:595)
          at org.eclipse.ui.internal.EditorAreaHelper.setVisibl eEditor(EditorAreaHelper.java:271)
          at org.eclipse.ui.internal.EditorManager.setVisibleEd itor(EditorManager.java:1417)
          at org.eclipse.ui.internal.EditorManager$5.runWithExc eption(EditorManager.java:942)
          at org.eclipse.ui.internal.StartupThreading$StartupRu nnable.run(StartupThreading.java:31)
          at org.eclipse.swt.widgets.RunnableLock.run(RunnableL ock.java:35)
          at org.eclipse.swt.widgets.Synchronizer.runAsyncMessa ges(Synchronizer.java:134)
          at org.eclipse.swt.widgets.Display.runAsyncMessages(D isplay.java:3885)
          at org.eclipse.swt.widgets.Display.readAndDispatch(Di splay.java:3506)
          at org.eclipse.ui.application.WorkbenchAdvisor.openWi ndows(WorkbenchAdvisor.java:803)
          at org.eclipse.ui.internal.Workbench$28.runWithExcept ion(Workbench.java:1384)
          at org.eclipse.ui.internal.StartupThreading$StartupRu nnable.run(StartupThreading.java:31)
          at org.eclipse.swt.widgets.RunnableLock.run(RunnableL ock.java:35)
          at org.eclipse.swt.widgets.Synchronizer.runAsyncMessa ges(Synchronizer.java:134)
          at org.eclipse.swt.widgets.Display.runAsyncMessages(D isplay.java:3885)
          at org.eclipse.swt.widgets.Display.readAndDispatch(Di splay.java:3506)
          at org.eclipse.ui.internal.Workbench.runUI(Workbench. java:2316)
          at org.eclipse.ui.internal.Workbench.access$4(Workben ch.java:2221)
          at org.eclipse.ui.internal.Workbench$5.run(Workbench. java:500)
          at org.eclipse.core.databinding.observable.Realm.runW ithDefault(Realm.java:332)
          at org.eclipse.ui.internal.Workbench.createAndRunWork bench(Workbench.java:493)
          at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Pl atformUI.java:149)
          at org.eclipse.ui.internal.ide.application.IDEApplica tion.start(IDEApplication.java:113)
          at org.eclipse.equinox.internal.app.EclipseAppHandle. run(EclipseAppHandle.java:194)
          at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.runApplication(EclipseAppLauncher.java: 110)
          at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.start(EclipseAppLauncher.java:79)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:368)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:179)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.eclipse.equinox.launcher.Main.invokeFramework( Main.java:559)
          at org.eclipse.equinox.launcher.Main.basicRun(Main.ja va:514)
          at org.eclipse.equinox.launcher.Main.run(Main.java:13 11)

          Comment


          • #6
            I don't know where this is coming from. I am adding some null checks to the code which should prevent the exception from occurring. Please let me know if this addresses your problem.

            If not, it would help if you could post some code that is failing for you.

            This fix will be available in the next nightly build of STS.

            Comment


            • #7
              Andrew, thanks for the reply and attention to the code with adding null checks.

              I deleted the installation and reinstalled 2.3.1. Then I updated to 2.3.2 and that did the trick. I'm enjoying the gsp editor.

              I wonder if it was file corruption from the unzip or some one-off occurence.

              Comment


              • #8
                Hi,

                I am also not able to open GSP file in STS 2.3.2. Same NullPointerException. Could you pls help me on this.

                Thanks
                Nick

                Comment


                • #9
                  Hi Nick,

                  Please try the nightly build of STS Grails tooling. It is available from this update site:

                  http://dist.springsource.com/snapshot/STS/nightly/e3.5

                  That is likely to work, but if not, please let me know and also include your stack trace.

                  Comment


                  • #10
                    Andrew,

                    Still it doesn't work.


                    java.lang.NullPointerException
                    at com.springsource.sts.grails.editor.gsp.tags.GSPMod elQueryCMProvider.<init>(GSPModelQueryCMProvider.j ava:53)
                    at com.springsource.sts.grails.editor.gsp.tags.GSPMod elQueryImpl.<init>(GSPModelQueryImpl.java:36)
                    at com.springsource.sts.grails.editor.gsp.tags.ModelQ ueryAdapterFactoryForGSP.createModelQuery(ModelQue ryAdapterFactoryForGSP.java:111)
                    at com.springsource.sts.grails.editor.gsp.tags.ModelQ ueryAdapterFactoryForGSP.createAdapter(ModelQueryA dapterFactoryForGSP.java:102)
                    at org.eclipse.wst.sse.core.internal.provisional.Abst ractAdapterFactory.adaptNew(AbstractAdapterFactory .java:120)
                    at org.eclipse.wst.sse.core.internal.provisional.Abst ractAdapterFactory.adapt(AbstractAdapterFactory.ja va:64)
                    at org.eclipse.wst.sse.core.internal.provisional.Abst ractNotifier.getAdapterFor(AbstractNotifier.java:9 3)
                    at org.eclipse.jst.jsp.core.internal.modelhandler.JSP ModelLoader.preLoadAdapt(JSPModelLoader.java:195)
                    at org.eclipse.wst.sse.core.internal.model.AbstractMo delLoader.createModel(AbstractModelLoader.java:124 )
                    at org.eclipse.wst.sse.core.internal.FileBufferModelM anager.getModel(FileBufferModelManager.java:721)
                    at org.eclipse.wst.sse.core.internal.model.ModelManag erImpl._getModelFor(ModelManagerImpl.java:658)
                    at org.eclipse.wst.sse.core.internal.model.ModelManag erImpl.getModelForEdit(ModelManagerImpl.java:1390)
                    at org.eclipse.wst.sse.ui.StructuredTextEditor.doSetI nput(StructuredTextEditor.java:1731)
                    at org.eclipse.ui.texteditor.AbstractTextEditor$19.ru n(AbstractTextEditor.java:3116)
                    at org.eclipse.jface.operation.ModalContext.runInCurr entThread(ModalContext.java:464)
                    at org.eclipse.jface.operation.ModalContext.run(Modal Context.java:372)
                    at org.eclipse.jface.window.ApplicationWindow$1.run(A pplicationWindow.java:759)
                    at org.eclipse.swt.custom.BusyIndicator.showWhile(Bus yIndicator.java:70)
                    at org.eclipse.jface.window.ApplicationWindow.run(App licationWindow.java:756)
                    at org.eclipse.ui.internal.WorkbenchWindow.run(Workbe nchWindow.java:2579)
                    at org.eclipse.ui.texteditor.AbstractTextEditor.inter nalInit(AbstractTextEditor.java:3134)
                    at org.eclipse.ui.texteditor.AbstractTextEditor.init( AbstractTextEditor.java:3161)
                    at org.eclipse.wst.sse.ui.StructuredTextEditor.init(S tructuredTextEditor.java:2321)
                    at org.eclipse.ui.internal.EditorManager.createSite(E ditorManager.java:798)
                    at org.eclipse.ui.internal.EditorReference.createPart Helper(EditorReference.java:644)
                    at org.eclipse.ui.internal.EditorReference.createPart (EditorReference.java:462)
                    at org.eclipse.ui.internal.WorkbenchPartReference.get Part(WorkbenchPartReference.java:595)
                    at org.eclipse.ui.internal.EditorReference.getEditor( EditorReference.java:286)
                    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEdit orBatched(WorkbenchPage.java:2857)
                    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEdit or(WorkbenchPage.java:2762)
                    at org.eclipse.ui.internal.WorkbenchPage.access$11(Wo rkbenchPage.java:2754)
                    at org.eclipse.ui.internal.WorkbenchPage$10.run(Workb enchPage.java:2705)
                    at org.eclipse.swt.custom.BusyIndicator.showWhile(Bus yIndicator.java:70)
                    at org.eclipse.ui.internal.WorkbenchPage.openEditor(W orkbenchPage.java:2701)
                    at org.eclipse.ui.internal.WorkbenchPage.openEditor(W orkbenchPage.java:2685)
                    at org.eclipse.ui.actions.OpenWithMenu.openEditor(Ope nWithMenu.java:344)
                    at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent( OpenWithMenu.java:192)
                    at org.eclipse.swt.widgets.EventTable.sendEvent(Event Table.java:84)
                    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.ja va:1003)
                    at org.eclipse.swt.widgets.Display.runDeferredEvents( Display.java:3910)
                    at org.eclipse.swt.widgets.Display.readAndDispatch(Di splay.java:3503)
                    at org.eclipse.ui.internal.Workbench.runEventLoop(Wor kbench.java:2405)
                    at org.eclipse.ui.internal.Workbench.runUI(Workbench. java:2369)
                    at org.eclipse.ui.internal.Workbench.access$4(Workben ch.java:2221)
                    at org.eclipse.ui.internal.Workbench$5.run(Workbench. java:500)
                    at org.eclipse.core.databinding.observable.Realm.runW ithDefault(Realm.java:332)
                    at org.eclipse.ui.internal.Workbench.createAndRunWork bench(Workbench.java:493)
                    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Pl atformUI.java:149)
                    at org.eclipse.ui.internal.ide.application.IDEApplica tion.start(IDEApplication.java:113)
                    at org.eclipse.equinox.internal.app.EclipseAppHandle. run(EclipseAppHandle.java:194)
                    at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.runApplication(EclipseAppLauncher.java: 110)
                    at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.start(EclipseAppLauncher.java:79)
                    at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:368)
                    at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:179)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:585)
                    at org.eclipse.equinox.launcher.Main.invokeFramework( Main.java:559)
                    at org.eclipse.equinox.launcher.Main.basicRun(Main.ja va:514)
                    at org.eclipse.equinox.launcher.Main.run(Main.java:13 11)
                    at org.eclipse.equinox.launcher.Main.main(Main.java:1 287)


                    Pls check again and let me know the fix.

                    Thanks
                    Nick

                    Comment


                    • #11
                      Hi there,

                      It does not seem that you are using the latest nightly build of Grails tooling. The source locations do not match up with what I have. It looks like your NPE is one that I fixed a short time ago, and is available from nightly.

                      Comment


                      • #12
                        Hi Andrew,

                        When I tried to update, getting the below error :


                        Code:
                        Cannot complete the install because one or more required items could not be found.
                          Software being installed: SpringSource Tool Suite (required) 2.3.3.201004120801-CI-R4887-B182 (com.springsource.sts.feature.group 2.3.3.201004120801-CI-R4887-B182)
                          Missing requirement: Spring Configuration Editor UI 2.3.3.201004120801-CI-R4887-B182 (com.springsource.sts.config.ui 2.3.3.201004120801-CI-R4887-B182) requires 'bundle org.springframework.ide.eclipse.batch 2.3.3' but it could not be found
                          Cannot satisfy dependency:
                            From: SpringSource Tool Suite (required) 2.3.3.201004120801-CI-R4887-B182 (com.springsource.sts.feature.group 2.3.3.201004120801-CI-R4887-B182)
                            To: com.springsource.sts.config.ui [2.3.3.201004120801-CI-R4887-B182]

                        What should I do now? Pls suggest me.

                        Thanks
                        Nick

                        Comment


                        • #13
                          Nightly build ran successfully and able to open GSP files in STS now.

                          Thanks Andrew.

                          Comment

                          Working...
                          X