jetztgradnet / grails-spy-plugin

Spy into Grails internals
http://blog.jetztgrad.net
Other
5 stars 1 forks source link

App with Spy plugin v 0.2 won't compile in Grails 2.1.1 #4

Open xnickmx opened 12 years ago

xnickmx commented 12 years ago

Assumptions:

  1. Grails 2.1.1
  2. Windows 7

How to reproduce:

  1. Create a new Grails app: "grails create-app test_spy"
  2. Add the Spy plugin as a dependency in BuildConfig.groovy: compile ":spy:0.2"
  3. Attempt to compile the app: "grails compile --stacktrace"

the output: | Compiling 71 source files | Warning The [getBeanByPath] action accepts a parameter of type [java.util.Map] which has not been marked with @Validat eable. Data binding will still be applied to this command object but the instance will not be validateable.

def getBeanByPath(Map beans, def path) { ^ | Compiling 71 source files. | Error Fatal error during compilation org.apache.tools.ant.BuildException: Compilation Failed (NOTE: Stack trace has be en filtered. Use --verbose to see entire trace.) java.lang.NullPointerException at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.codehaus.gant.GantBuilder.invokeMethod(GantBuilder.java:99) at _GrailsCompile_groovy$_run_closure3_closure8_closure9.doCall(_GrailsCompile_groovy:62) at _GrailsCompile_groovy$_run_closure3_closure8_closure9.doCall(_GrailsCompile_groovy) at java_util_concurrent_Callable$call.call(Unknown Source) at _GrailsCompile_groovy.withCompilationErrorHandling(_GrailsCompile_groovy:69) at _GrailsCompile_groovy.this$4$withCompilationErrorHandling(_GrailsCompile_groovy) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:168) at _GrailsCompile_groovy$_run_closure3_closure8.doCall(_GrailsCompile_groovy:61) at _GrailsCompile_groovy$_run_closure3_closure8.doCall(_GrailsCompile_groovy) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at _GrailsCompile_groovy$_run_closure3.doCall(_GrailsCompile_groovy:58) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:1 85) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) at java_util_concurrent_Callable$call.call(Unknown Source) at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) at org.codehaus.gant.GantMetaClass.processClosure(GantMetaClass.java:81) at org.codehaus.gant.GantMetaClass.processArgument(GantMetaClass.java:95) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:128) at _GrailsCompile_groovy$_run_closure2.doCall(_GrailsCompile_groovy:45) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:1 85) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) at java_util_concurrent_Callable$call.call(Unknown Source) at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) at java_util_concurrent_Callable$call.call(Unknown Source) at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy) at java_util_concurrent_Callable$call.call(Unknown Source) at gant.Gant.withBuildListeners(Gant.groovy:427) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:415) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.executeTargets(Gant.groovy:591) at gant.Gant.executeTargets(Gant.groovy:590) | Error Fatal error during compilation org.apache.tools.ant.BuildException: Compilation Failed

jetztgradnet commented 12 years ago

Hi,

could you try to add a simple "protected" in front of the method? Since 2.0, Grails treats all public methods as controller actions, but this is a simple helper method and should be protected. Also see issue #2.