Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Cannot open GSP editor

  1. #1

    Default 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. #2

    Default

    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.

  3. #3
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    750

    Default

    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.

  4. #4

    Default

    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

  5. #5
    Join Date
    Mar 2010
    Location
    Evergreen, CO
    Posts
    2

    Default 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)

  6. #6
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    750

    Default

    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.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  7. #7
    Join Date
    Mar 2010
    Location
    Evergreen, CO
    Posts
    2

    Default

    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.

  8. #8
    Join Date
    Apr 2010
    Posts
    4

    Default

    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

  9. #9
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    750

    Default

    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.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  10. #10
    Join Date
    Apr 2010
    Posts
    4

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •