Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7408

Reflection failed when the system time is before the last modified time of the groovy script

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 1.8.3, 2.4.1
    • None
    • GroovyScriptEngine
    • None
    • redhat 6.0

    Description

      Hi,

      I use GroovyScriptEngine to run a groovy script from java program. Inside the groovy script, I use Class.forName to load another groovy class. However, if the operating system time is behind the groovy file last modified time, following exception will be thrown:

      java.lang.NoSuchMethodException: scripts.A.<init>(scripts.A, java.lang.String, java.lang.String, java.lang.String)
      at java.lang.Class.getConstructor0(Unknown Source)
      at java.lang.Class.getConstructor(Unknown Source)
      at java_lang_Class$getConstructor$1.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:122)
      at scripts.B.create(B.groovy:41)
      at scripts.B$create.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:114)
      at scripts.enrich.run(enrich.groovy:38)
      at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:589)

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            zydoi Ethan Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: