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

Groovy sources with Grape grabs fail to load from bytecode (race condition)

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:

      Description

      The bytecode of Groovy sources with Grape grabs contains a static initializer that calls Grape#grab(...). But since the bytecode also references classes that can only be loaded after grabbing the dependencies and adding them to a parent class loader, loading such referenced classes may fail due to a race condition with a NoClassDefFoundError.

      See the thread titled "Grape and loading classes that extend java.lang.Exception from compiled Groovy bytecode" in the Groovy Dev Mailing List of Feb/Mar 2017 for sample sources and discussion:

      http://groovy.329449.n5.nabble.com/Grape-and-loading-classes-that-extend-java-lang-Exception-from-compiled-Groovy-bytecode-tp5738786.html

      Although it appears almost certain that no fix will be possible, except maybe as part of a redesign for major release, I am reporting this so that it is documented.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jexler Jex Jexler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: