groovy
  1. groovy
  2. GROOVY-2792

Unwanted InvokerInvocationException

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.6-beta-1
    • Fix Version/s: 1.6-rc-1
    • Component/s: None
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      Both tests in the appended code fails with an uncaught exception under 1.6.

      class G16BugTest extends GroovyTestCase {
          void testAssert() {
              try {
                  new G16BugHelper().check()
              } catch (AssertionError e) {
                  // ignore
              }
          }
      
          void testCopy() {
              def inst = new Copy()
              inst.sourceDir = '/Users/hans/tmp/garbage/d1/' as File
              inst.targetDir = '/Users/hans/tmp/garbage/d2/' as File
              inst.execute()
          }
      }
      
      class G16BugHelper {
          void check() {
              assert 0 > 1
          }
      }
      
      class Copy {
          File sourceDir
          File targetDir
      
          void execute() {
             AntBuilder ant = new AntBuilder()
              ant.copy(todir: targetDir) {
                  fileset(dir: sourceDir)
              }
          }
      }
      

      testAssert fails with:

      org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.AssertionError: Expression: (0 > 1)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:892)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:743)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:769)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:749)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:160)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:185)
      	at G16BugTest.testAssert(G16BugTest.groovy:6)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
      Caused by: java.lang.AssertionError: Expression: (0 > 1)
      	at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:372)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:642)
      	at G16BugHelper.check(G16BugTest.groovy:22)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
      	... 26 more
      

      testCopy fails with

      org.codehaus.groovy.runtime.InvokerInvocationException: org.codehaus.groovy.runtime.InvokerInvocationException: org.codehaus.groovy.runtime.InvokerInvocationException: org.codehaus.groovy.runtime.InvokerInvocationException: org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: Copy.fileset() is applicable for argument types: (java.util.LinkedHashMap) values: {[dir:/Users/hans/tmp/garbage/d1]}
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:892)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:743)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:769)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:749)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:160)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:185)
      	at G16BugTest.testCopy(G16BugTest.groovy:16)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
      Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: org.codehaus.groovy.runtime.InvokerInvocationException: org.codehaus.groovy.runtime.InvokerInvocationException: org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: Copy.fileset() is applicable for argument types: (java.util.LinkedHashMap) values: {[dir:/Users/hans/tmp/garbage/d1]}
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:248)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:743)
      	at groovy.lang.Closure.call(Closure.java:292)
      	at groovy.lang.Closure.call(Closure.java:287)
      	at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:148)
      	at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:149)
      	at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:775)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:749)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:160)
      	at Copy.execute(G16BugTest.groovy:33)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
      	... 26 more
      Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: org.codehaus.groovy.runtime.InvokerInvocationException: org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: Copy.fileset() is applicable for argument types: (java.util.LinkedHashMap) values: {[dir:/Users/hans/tmp/garbage/d1]}
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:248)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:76)
      	at Copy$_execute_closure1.doCall(G16BugTest.groovy)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
      	... 43 more
      Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: Copy.fileset() is applicable for argument types: (java.util.LinkedHashMap) values: {[dir:/Users/hans/tmp/garbage/d1]}
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:892)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:743)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:757)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:745)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:160)
      	at Copy.invokeMethod(G16BugTest.groovy)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:371)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:322)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:76)
      	at Copy$_execute_closure1.doCall(G16BugTest.groovy:34)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
      	... 52 more
      Caused by: org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: Copy.fileset() is applicable for argument types: (java.util.LinkedHashMap) values: {[dir:/Users/hans/tmp/garbage/d1]}
      

        Activity

        Hide
        Jim White added a comment -

        Test as I ran it.

        Show
        Jim White added a comment - Test as I ran it.
        Hide
        Peter Niederwieser added a comment -

        Not sure if this helps but:
        Building ("gradle libs") gradle svn head with gradle 0.1.3 succeeds. But when I replace either gradle's lib/groovy-all-1.5.5.jar with a Groovy jar built from 1.6 trunk, I get tons of InvokerInvocationException's.

        Show
        Peter Niederwieser added a comment - Not sure if this helps but: Building ("gradle libs") gradle svn head with gradle 0.1.3 succeeds. But when I replace either gradle's lib/groovy-all-1.5.5.jar with a Groovy jar built from 1.6 trunk, I get tons of InvokerInvocationException's.
        Hide
        Hans Dockter added a comment -

        This had been the next thing I would have asked for. Because this is my original problem and its good to know that it is reproducible. I had a closer look at the tests which failed and came up with the ones above to reproduce the problems in an easy way. Its strange that those tests only fail for me. I gonna have a fresh look at this tomorrow.

        Thanks

        • Hans
        Show
        Hans Dockter added a comment - This had been the next thing I would have asked for. Because this is my original problem and its good to know that it is reproducible. I had a closer look at the tests which failed and came up with the ones above to reproduce the problems in an easy way. Its strange that those tests only fail for me. I gonna have a fresh look at this tomorrow. Thanks Hans
        Hide
        blackdrag blackdrag added a comment -

        any updates on this?

        Show
        blackdrag blackdrag added a comment - any updates on this?
        Hide
        blackdrag blackdrag added a comment -

        I am closing this for now... If Hans can reprodcue the issue with beta2, then please repoen it.

        Show
        blackdrag blackdrag added a comment - I am closing this for now... If Hans can reprodcue the issue with beta2, then please repoen it.

          People

          • Assignee:
            blackdrag blackdrag
            Reporter:
            Hans Dockter
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: