You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/02/21 02:14:00 UTC

[jira] [Resolved] (GROOVY-9409) org.codehaus.groovy.runtime.callsite.GroovySunClassLoader is unusable

     [ https://issues.apache.org/jira/browse/GROOVY-9409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King resolved GROOVY-9409.
-------------------------------
    Fix Version/s: 3.0.2
                   4.0.0-alpha-1
                   2.5.10
         Assignee: Paul King
       Resolution: Fixed

The behavior for our use hasn't changed since it broke JDK8 when I tried but there is now an overloaded constructor that you could use to use different parsing options for your use case.

But as Jochen alluded to, this is treated as mainly an internal class which in fact won't work under JDK11 anyway. We are likely to deprecate and remove this class at some point. In our current planning it won't be needed for internal use by Groovy 4 when we are all indy code based.

> org.codehaus.groovy.runtime.callsite.GroovySunClassLoader is unusable
> ---------------------------------------------------------------------
>
>                 Key: GROOVY-9409
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9409
>             Project: Groovy
>          Issue Type: Bug
>          Components: bytecode
>    Affects Versions: 3.0.0
>         Environment: OpenJDK 8u222
>            Reporter: Baltasar Trancon Widemann
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 2.5.10, 4.0.0-alpha-1, 3.0.2
>
>         Attachments: Example.java
>
>
> The singleton class loader supposedly defined by {{org.codehaus.groovy.runtime.callsite.GroovySunClassLoader}} cannot be used. The creation of the instance fails with a {{ClassFormatError}}. The attached Java code demonstrates the issue:
> {noformat}
> $ javac -classpath $HOME/.m2/repository/org/codehaus/groovy/groovy/3.0.0/groovy-3.0.0.jar Example.java 
> $ java -classpath .:$HOME/.m2/repository/org/codehaus/groovy/groovy/3.0.0/groovy-3.0.0.jar Example
> GroovySunClassLoader.sunVM = null
> Creating a new GroovySunClassLoader ...
> Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file org/codehaus/groovy/runtime/callsite/AbstractCallSite
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
> 	at org.codehaus.groovy.reflection.SunClassLoader.define(SunClassLoader.java:95)
> 	at org.codehaus.groovy.runtime.callsite.GroovySunClassLoader.loadAbstract(GroovySunClassLoader.java:69)
> 	at org.codehaus.groovy.runtime.callsite.GroovySunClassLoader.<init>(GroovySunClassLoader.java:51)
> 	at Example$1.<init>(Example.java:7)
> 	at Example.main(Example.java:7)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)