atom feed14 messages in org.codehaus.groovy.userException after findAll() on a DataSet
FromSent OnAttachments
Peter RohanNov 30, 2006 11:46 am 
Jochen TheodorouNov 30, 2006 2:15 pm 
Lance ShawFeb 13, 2007 2:09 pm 
Lance ShawFeb 13, 2007 3:19 pm 
Jochen TheodorouFeb 14, 2007 5:04 am 
Marc DeXeTFeb 23, 2007 2:56 am 
Jochen TheodorouFeb 23, 2007 3:23 am 
Brandon168Apr 10, 2007 7:22 am 
svenson_2703Sep 22, 2011 3:01 am 
Paul KingSep 22, 2011 2:42 pm 
svenson_2703Sep 23, 2011 4:15 am 
Paul KingSep 23, 2011 4:56 am 
svenson_2703Sep 23, 2011 5:57 am 
Paul KingSep 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