GMaven
  1. GMaven
  2. GMAVEN-104

running print "hello" in the groovy console causes an exception

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.3, 1.4
    • Fix Version/s: 1.5
    • Component/s: execute
    • Labels:
      None
    • Environment:
      $ uname -a
      Linux tasha 3.0.0-22-generic-pae #36-Ubuntu SMP Tue Jun 12 17:31:49 UTC 2012 i686 i686 i386 GNU/Linux
    • Number of attachments :
      0

      Description

      Ran mvn groovy:console when I wanted to test a few ideas, but got an exception: the script hangs and cannot be interrupted.

      I haven't used the feature for quite a while, but it used to work (a year ago?). I have no idea how to work around it.

      Console output:

      groovy> println "test"

      test
      Exception in thread "Thread-4"
      groovy.lang.MissingPropertyException: No such property: scriptRunning for class: org.codehaus.gmaven.runtime.v1_7.ConsoleFeature$ConsoleImpl$1
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setGroovyObjectProperty(ScriptBytecodeAdapter.java:533)
      at groovy.ui.Console$_runScriptImpl_closure16.doCall(Console.groovy:918)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
      at groovy.ui.Console$_runScriptImpl_closure16.doCall(Console.groovy)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
      at groovy.lang.Closure.call(Closure.java:282)
      at groovy.lang.Closure.call(Closure.java:277)
      at groovy.lang.Closure.run(Closure.java:360)
      at java.lang.Thread.run(Thread.java:679)

        Activity

        Hide
        Keegan Witt added a comment -

        I'm surprised this hasn't been noticed yet (though it's a feature I don't use much). I believe this upstream change to fix GROOVY-3854 broke our mojo. I've got to do some more testing before I know what we'll have to do to get the mojo working again.

        Show
        Keegan Witt added a comment - I'm surprised this hasn't been noticed yet (though it's a feature I don't use much). I believe this upstream change to fix GROOVY-3854 broke our mojo. I've got to do some more testing before I know what we'll have to do to get the mojo working again.
        Hide
        Keegan Witt added a comment -

        It's because they made this new field private without any getters/setters. I can use reflection to get the field for now. I might open an issue for Groovy project to make the new fields accessible.

        Show
        Keegan Witt added a comment - It's because they made this new field private without any getters/setters. I can use reflection to get the field for now. I might open an issue for Groovy project to make the new fields accessible.
        Hide
        Tomislav Nakic-Alfirevic added a comment -

        Apparently, the 1.5 provider (ver. 1.4) doesn't have this problem (see GMAVEN-103): the provider rollback might cause other problems, though...

        Show
        Tomislav Nakic-Alfirevic added a comment - Apparently, the 1.5 provider (ver. 1.4) doesn't have this problem (see GMAVEN-103 ): the provider rollback might cause other problems, though...
        Hide
        Tomislav Nakic-Alfirevic added a comment -

        Switched to gmaven-runtime-2.0 (version 1.4):

        <dependency>
        <groupId>org.codehaus.gmaven.runtime</groupId>
        <artifactId>gmaven-runtime-2.0</artifactId>
        <version>1.4</version>
        </dependency>

        Appears to work perfectly.

        Show
        Tomislav Nakic-Alfirevic added a comment - Switched to gmaven-runtime-2.0 (version 1.4): <dependency> <groupId>org.codehaus.gmaven.runtime</groupId> <artifactId>gmaven-runtime-2.0</artifactId> <version>1.4</version> </dependency> Appears to work perfectly.

          People

          • Assignee:
            Keegan Witt
            Reporter:
            Tomislav Nakic-Alfirevic
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: