Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.2
-
None
-
None
Description
myscript.groovy
ExpandoMetaClass.enableGlobally() Object[] myObjectArray = ['a', 'b'] as Object[] closure = { println 'closure running...' } closure(myObjectArray)
code $ groovy -version Groovy Version: 1.8.2 JVM: 1.6.0_26 code $ groovy myscript.groovy Caught: groovy.lang.MissingMethodException: No signature of method: myscript$_run_closure1.doCall() is applicable for argument types: (java.lang.String, java.lang.String) values: [a, b] Possible solutions: doCall(), doCall(java.lang.Object), call(), call([Ljava.lang.Object;), call(java.lang.Object), findAll() groovy.lang.MissingMethodException: No signature of method: myscript$_run_closure1.doCall() is applicable for argument types: (java.lang.String, java.lang.String) values: [a, b] Possible solutions: doCall(), doCall(java.lang.Object), call(), call([Ljava.lang.Object;), call(java.lang.Object), findAll() at myscript.run(myscript.groovy:9)
I have tested with versions all the way back to 1.7.0 and the exception is thrown for all the versions I tested.
If I remove the ExpandoMetaClass.enableGlobally(), the exception goes away.
I think this is related to http://jira.grails.org/browse/GRAILS-8002, though I am not sure why that problem just showed up in Grails 2.0-M2. I have not been able to reproduce it with Grails 1.3.7.