org.codehaus.groovy.grails.cli.support.GrailsStarter - SpringSource

While trying to set up Spring Source to develop a Groovy on Grails application a developer may encounter a Java exception as shown below;
java.lang.NoClassDefFoundError: org/codehaus/groovy/tools/RootLoader
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.tools.RootLoader
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Exception in thread "main
Additionally on the Spring Source IDE, following error messages can also be visible;
---------------------------
Java Virtual Machine Launcher
---------------------------
Could not find the main class: org.codehaus.groovy.grails.cli.support.GrailsStarter.  Program will exit.
---------------------------
In this blog post, we will aim to provide a solution to such a problem and what you need to do to fix and get your grails application running in such cases.This problem often arises due to a compatibility issue between the version of Grails installed and the Spring Source version that is installed in your system.The first step you have to do is to read the documentation of Spring Source to make sure that the version of Grails you are using is certified for the IDE version. This could be the reason for this problem, and in this case you will want to install the right version of Grails that is supported by the IDE to get things working. I was running version 2.6.1 SR1, and Grails 1.4 was not accepted by the IDE. Downgrading to 1.3x version of Grails, helped to resolve this problem.

1 comment: