views:

434

answers:

3
+2  Q: 

Grails in Eclipse

I'm trying to follow some of the introduction to Grails tutorials and am at the point where I want to try to see if I can use a debugger in Eclipse with my Grails applications. My grails application runs fine when I use the command to execute, but when I tried to use the Eclipse run configuration, I get the following error:

Exception in thread "main" java.lang.NullPointerException
at java.io.File.<init>(File.java:194)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:107)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:192)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:200)
at grails.util.GrailsMain.run(GrailsMain.groovy:27)
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:585)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1062)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:893)
at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:744)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:727)
at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:383)
at org.codehaus.groovy.runtime.InvokerHelper$runScript.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:129)
at grails.util.GrailsMain.main(GrailsMain.groovy)

I figure it's a configuration issue (I did recently set the GRAILS_HOME environment variable and that seems to be correct) but that error message doesn't really give me much to go.

Suggestions?

+2  A: 

I was never able to get grails to work properly in eclipse. You may want to try Netbeans though the 6.7 version has improved grails support.

Jared
+1  A: 

Have you installed the Groovy Eclipse Plugin?

IIRC, you need this to enable Groovy debugging --- take a look at this page for a step by step about setting up the eclipse debugger - http://www.grails.org/Eclipse+IDE+Integration

But Jared is right, Netbeans step debugger is so much nicer --- http://www.grailsblog.com/archive/show?id=13

tomas
+1  A: 

Besides grails home, try setting JAVA_HOME environment variable.

Raphael