Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.0
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)