I’m using Eclipse with the SpringSource Tool Suite. After importing a Grails Project, I wanted to open a GSP-page but got the following error in the Editor:
Could not open the editor: Editor could not be initialized.
The stacktrace looks as follows:
java.lang.NullPointerException at com.springsource.sts.grails.editor.gsp.tags.GSPModelQueryCMProvider.(GSPModelQueryCMProvider.java:53) at com.springsource.sts.grails.editor.gsp.tags.GSPModelQueryImpl.(GSPModelQueryImpl.java:36) ... at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
The error occurs because Eclipse (STS) wants to open GSP-files with the GSP Editor (because of File Associations) even if the project is not a Grails Project.
So the solution is to convert the project in a Grails Project: right click on your project → “Configure” | “Convert to Grails-Project”.
Versions: Eclipse 3.5, STS 2.3, Grails 1.1.1