jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-2450

DataSet.findAll does not work directly from script outside CLASSPATH or in pre-compiled bytecode (*.class file)

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.5
  • Fix Version/s: None
  • Component/s: SQL processing
  • Labels:
    None
  • Environment:
    Windows XP Media Edition, Service Pack 2, jdk1.6.0_03
  • Testcase included:
    yes

Description

It appears that the DataSet.findAll does not function properly when used in a script outside of the CLASSPATH or in a groovy class-precompiled into byte code. Tested with This may be related to GROOVY-1877. See http://tinyurl.com/yrlmnv for more info. This has been tested with MySQL and Derby.

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. GROOVY-1877 DataSet's findAll-method with a closure and a SQL-WHERE-condition within

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Improvement - An improvement or enhancement to an existing feature or task. GROOVY-544 Save the ClassNode AST by default

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
David Bennett added a comment - 26/Dec/07 9:11 PM

Issue only occurs when a Closure is specified as a parameter to DataSet.findAll

Show
David Bennett added a comment - 26/Dec/07 9:11 PM Issue only occurs when a Closure is specified as a parameter to DataSet.findAll
Hide
Permalink
Paul King added a comment - 10/Feb/08 3:46 AM

possibly a duplicate

Show
Paul King added a comment - 10/Feb/08 3:46 AM possibly a duplicate
Hide
Permalink
Corrado added a comment - 05/Jun/09 2:26 AM

DataSet.findAll is a powerfull API, but it is not currently working on Groovy 1.6.3:
groovy.lang.GroovyRuntimeException: Could not find the ClassNode for MetaClass: org.codehaus.groovy.runtime.metaclass.ClosureMetaClass@bf5555

Show
Corrado added a comment - 05/Jun/09 2:26 AM DataSet.findAll is a powerfull API, but it is not currently working on Groovy 1.6.3: groovy.lang.GroovyRuntimeException: Could not find the ClassNode for MetaClass: org.codehaus.groovy.runtime.metaclass.ClosureMetaClass@bf5555
Hide
Permalink
Paul King added a comment - 05/Jun/09 4:33 AM

Hi Corrado, I believe this is the error message you get if your src file isn't on your CLASSPATH. Can you try adding it on. Also pre-compilation isn't currently supported.

Show
Paul King added a comment - 05/Jun/09 4:33 AM Hi Corrado, I believe this is the error message you get if your src file isn't on your CLASSPATH. Can you try adding it on. Also pre-compilation isn't currently supported.
Hide
Permalink
Roberto added a comment - 14/Oct/09 7:13 PM

I have the same problem. Working with GRECLIPSE v2, eclipse 3.5, java 1.6.0_26, groovy 1.7-beta1

This works:

def names = sql.dataSet("MITABLA");
def result = names.findAll();

result.each ({ println(it.NAME); })

But if I put a closure inside findAll, it fails when trying to execute result.each (...)

def names = sql.dataSet("MITABLA");
def result = names.findAll({it.NAME == "ROBERTO"});

result.each ({ println(it.NAME); } })

Could not find the ClassNode for MetaClass: org.codehaus.groovy.runtime.metaclass.ClosureMetaClass@c5e9c[class GroovyBBDD$_main_closure2]

Show
Roberto added a comment - 14/Oct/09 7:13 PM I have the same problem. Working with GRECLIPSE v2, eclipse 3.5, java 1.6.0_26, groovy 1.7-beta1 This works: def names = sql.dataSet("MITABLA"); def result = names.findAll(); result.each ({ println(it.NAME); }) But if I put a closure inside findAll, it fails when trying to execute result.each (...) def names = sql.dataSet("MITABLA"); def result = names.findAll({it.NAME == "ROBERTO"}); result.each ({ println(it.NAME); } }) Could not find the ClassNode for MetaClass: org.codehaus.groovy.runtime.metaclass.ClosureMetaClass@c5e9c[class GroovyBBDD$_main_closure2]
Hide
Permalink
Paul King added a comment - 14/Oct/09 9:28 PM

Roberto, is the path to your src file in your CLASSPATH?

Show
Paul King added a comment - 14/Oct/09 9:28 PM Roberto, is the path to your src file in your CLASSPATH?
Hide
Permalink
Corrado added a comment - 23/Dec/09 9:52 AM

Hi Paul, I'm sorry for the late reply.
I tested again with groovy 1.7.0 and the issue is still there.
My script is a .groovy file so from what you wrote, my case is the "Also pre-compilation isn't currently supported".
Hoping also pre-compilation support will be added soon
I tried also using groovyc-java (instead of groovy datasettest.groovy )same result
Thanks
Corrado

Show
Corrado added a comment - 23/Dec/09 9:52 AM Hi Paul, I'm sorry for the late reply. I tested again with groovy 1.7.0 and the issue is still there. My script is a .groovy file so from what you wrote, my case is the "Also pre-compilation isn't currently supported". Hoping also pre-compilation support will be added soon I tried also using groovyc-java (instead of groovy datasettest.groovy )same result Thanks Corrado
Hide
Permalink
Szymon Polom added a comment - 03/Feb/10 8:40 AM

Documentation on http://groovy.codehaus.org/Database+features should be updated to reflect this ongoing issue.

Pre-compiled bytecode is common and it is a bit strange to run into this exception with code taken from documentation.

Show
Szymon Polom added a comment - 03/Feb/10 8:40 AM Documentation on http://groovy.codehaus.org/Database+features should be updated to reflect this ongoing issue. Pre-compiled bytecode is common and it is a bit strange to run into this exception with code taken from documentation.
Hide
Permalink
blackdrag blackdrag added a comment - 05/Jan/11 7:21 AM

I have a replacement bug for this one now in GROOVY-4618 since the original idea with saving the ClassNode directly seemed not to bea good way to solve the problem

Show
blackdrag blackdrag added a comment - 05/Jan/11 7:21 AM I have a replacement bug for this one now in GROOVY-4618 since the original idea with saving the ClassNode directly seemed not to bea good way to solve the problem

People

  • Assignee:
    blackdrag blackdrag
    Reporter:
    David Bennett
Vote (5)
Watch (4)

Dates

  • Created:
    26/Dec/07 9:09 PM
    Updated:
    05/Jan/11 7:21 AM
    Resolved:
    05/Jan/11 7:21 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.