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

org.codehaus.groovy.runtime.callsite.GroovySunClassLoader is unusable

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 2.5.10, 4.0.0-alpha-1, 3.0.2
    • Component/s: bytecode
    • Labels:
      None
    • Environment:
      OpenJDK 8u222

      Description

      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:

      $ 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)
      

        Attachments

        1. Example.java
          0.3 kB
          Baltasar Trancon Widemann

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              widemann Baltasar Trancon Widemann
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: