| From | Sent On | Attachments |
|---|---|---|
| Peter Rohan | Nov 30, 2006 11:46 am | |
| Jochen Theodorou | Nov 30, 2006 2:15 pm | |
| Lance Shaw | Feb 13, 2007 2:09 pm | |
| Lance Shaw | Feb 13, 2007 3:19 pm | |
| Jochen Theodorou | Feb 14, 2007 5:04 am | |
| Marc DeXeT | Feb 23, 2007 2:56 am | |
| Jochen Theodorou | Feb 23, 2007 3:23 am | |
| Brandon168 | Apr 10, 2007 7:22 am | |
| svenson_2703 | Sep 22, 2011 3:01 am | |
| Paul King | Sep 22, 2011 2:42 pm | |
| svenson_2703 | Sep 23, 2011 4:15 am | |
| Paul King | Sep 23, 2011 4:56 am | |
| svenson_2703 | Sep 23, 2011 5:57 am | |
| Paul King | Sep 23, 2011 4:55 pm |
| Subject: | Exception after findAll() on a DataSet | |
|---|---|---|
| From: | Peter Rohan (alwa...@gmail.com) | |
| Date: | Nov 30, 2006 11:46:48 am | |
| List: | org.codehaus.groovy.user | |
Hi,
I'm getting an error when using the method findAll() on a DataSet. findAll() does return a new DataSet, but for example when I loop on it with each(), an exception is thrown:
Exception in thread "main" groovy.lang.GroovyRuntimeException: Could not find the ClassNode for MetaClass: groovy.lang.MetaClassImpl@132e13d[class mypackage.MyClass$_main_closure1] at groovy.sql.DataSet.getSqlVisitor(DataSet.java:190) at groovy.sql.DataSet.getSql(DataSet.java:164) at groovy.sql.DataSet.each(DataSet.java:153) ...
It seems that in getSqlVisitor() of DataSet, I am falling in this case : 188 ClassNode classNode = where.getMetaClass().getClassNode(); 189 if (classNode == null) { 190 throw new GroovyRuntimeException( 191 "Could not find the ClassNode for MetaClass: " + where.getMetaClass()); 192 }
I am a beginner to Groovy and don't know much about it's MOP, but it seems that: println {println "hello"}.getMetaClass().classNode // prints MyClass$_main_closure1@ab95e6 def closure = {println "hello"} println closure.getMetaClass().classNode // prints null
This would explain the exception I get with DataSet.
So what's wrong? I am using groovy-1.0-JSR-06.
-- Olivier Armand





