Discussion:
MissingMethodException... Groovy/Grails bug?
Pablo Molnar
2012-01-24 14:50:56 UTC
Permalink
Hi there,

Every so my grails app log a MissingMethodException. The funny side is that
the exception suggest as possible solution the "missing" method with object
as parameter...


groovy.lang.MissingMethodException: No signature of method: static
java.util.Map.isCase() is applicable for argument types: (java.lang.String)
values: [MLC1276]
Possible solutions: isCase(java.lang.Object), *isCase(java.lang.Object)*,
asType(java.lang.Class), asType(java.lang.Class), is(java.lang.Object),
use([Ljava.lang.Object;)


groovy.lang.MissingMethodException: No signature of method: static
java.util.Collection.isCase() is applicable for argument types:
(java.lang.String) values: [/categories/MCR100554/attributes]
Possible solutions: isCase(java.lang.Object),
*isCase(java.lang.Object),*asList(), asType(java.lang.Class),
asType(java.lang.Class),
use([Ljava.lang.Object;)

Environment:
- Grails 1.3.7
- Ubuntu 64 bits

Any idea?

Pablo
Ian Roberts
2012-01-24 14:58:49 UTC
Permalink
Post by Pablo Molnar
Hi there,
Every so my grails app log a MissingMethodException. The funny side is
that the exception suggest as possible solution the "missing" method
with object as parameter...
groovy.lang.MissingMethodException: No signature of method: static
(java.lang.String) values: [MLC1276]
Possible solutions: isCase(java.lang.Object),
*isCase(java.lang.Object)*, asType(java.lang.Class),
asType(java.lang.Class), is(java.lang.Object), use([Ljava.lang.Object;)
Note the "static" in the error message. You're trying to call a static
isCase method on your class and it's suggesting that maybe you meant to
call the non-static isCase(Object) instead.

Ian
--
Ian Roberts | Department of Computer Science
***@dcs.shef.ac.uk | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Pablo Molnar
2012-01-24 17:47:47 UTC
Permalink
Hi Ian, thanks for replying.

That didn't explain why the code works most of the time. I've have only a
few errors per day...
Also I've tested the following snippet calling the static and non-static
method without any exceptions.

println ([foo:1, bar:2].isCase('foo'))
println (Map.isCase('foo'))

*Result:*
true
false


I'm feeling that is something related with the groovy/java classloader
since the java.util.Map.isCase() method belongs to the groovy sdk:
http://groovy.codehaus.org/groovy-jdk/java/util/Map.html#isCase%28java.lang.Object%29

Cheers,
Pablo
Post by Ian Roberts
Post by Pablo Molnar
Hi there,
Every so my grails app log a MissingMethodException. The funny side is
that the exception suggest as possible solution the "missing" method
with object as parameter...
groovy.lang.MissingMethodException: No signature of method: static
(java.lang.String) values: [MLC1276]
Possible solutions: isCase(java.lang.Object),
*isCase(java.lang.Object)*, asType(java.lang.Class),
asType(java.lang.Class), is(java.lang.Object), use([Ljava.lang.Object;)
Note the "static" in the error message. You're trying to call a static
isCase method on your class and it's suggesting that maybe you meant to
call the non-static isCase(Object) instead.
Ian
--
Ian Roberts | Department of Computer Science
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
Loading...