You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Jex Jexler (JIRA)" <ji...@apache.org> on 2017/03/05 09:45:32 UTC

[jira] [Created] (GROOVY-8108) Groovy sources with Grape grabs fail to load from bytecode (race condition)

Jex Jexler created GROOVY-8108:
----------------------------------

             Summary: Groovy sources with Grape grabs fail to load from bytecode (race condition)
                 Key: GROOVY-8108
                 URL: https://issues.apache.org/jira/browse/GROOVY-8108
             Project: Groovy
          Issue Type: Bug
          Components: Compiler
            Reporter: Jex Jexler


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.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)