views:

470

answers:

3

I'm getting the following error when I try to build a war in Grails. Any thoughts on what could be causing the issue? Any tips on debugging the Groovy scripts that are building the war?

[web] $ cmd.exe /C D:\dev\tools\grails-1.1\bin\grails.bat war cloudfi.war && exit %%ERRORLEVEL%% Welcome to Grails 1.1 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: D:\dev\tools\grails-1.1

Base Directory: D:\dev\workspace.hudson\jobs\cloudfi\workspace\trunk\web Running script D:\dev\tools\grails-1.1\scripts\War.groovy Environment set to production Warning, target causing name overwriting of name startLogging null java.lang.NullPointerException at org.codehaus.groovy.runtime.InvokerHelper.getAttribute(InvokerHelper.java:129) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getField(ScriptBytecodeAdapter.java:305) at org.codehaus.groovy.grails.plugins.PluginInfo.getName(PluginInfo.groovy:53) ... at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:187) at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:212)

A: 

Looking at the text of the error message, my first guess would be that somewhere in your code you're defining a method or field called "startLogging" that collides with some of the "magic" that Grails is performing.

Michael Borgwardt
+2  A: 

it may be worth trying a grails clean before building the app. Line 129 of invokerHelper is:

129  public static Object invokeStaticMethod(String klass, String methodName, Object arguments) throws ClassNotFoundException {
130         Class type = InvokerHelper.class.forName(klass);
131         return getInstance().invokeStaticMethod(type, methodName, arguments);
132     }

so I suspect that you have a plugin or classpath problem- cleaning up the install may help it.

Tim Howland
+1  A: 

Try a grails clean. If that doesn't work try deleting your application Data.grails or it's equivalent folder on your system. I've had similar issues and deleting that folder has always fixed them.

Jared