jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-292

Groovy and ibm jdk1.4.1 java.lang.ClassCircularityError

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-beta-4
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows, IBM JDK 1.4.1 Cygwin or cmd.exe

Description

Running groovy or groovyConsole with the ibm 1.4.1 jdk produces the following exception:
Exception in thread "main" java.lang.ClassCircularityError: groovy/lang/Closure$WritableClosure
at java.lang.ClassLoader.resolveClass0(Native Method)
at java.lang.ClassLoader.resolveClass(ClassLoader.java:920)
at java.lang.ClassLoader.loadClass(ClassLoader.java:565)
at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:136)
at org.codehaus.classworlds.ClassRealmImpl.loadClassDirect(ClassRealmImpl.java:262)
at org.codehaus.classworlds.ClassRealmImpl.loadClass(ClassRealmImpl.java:239)
at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:155)
at java.lang.ClassLoader.loadClass(ClassLoader.java:494)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:146)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$500(URLClassLoader.java:107)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:844)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:369)
at java.lang.ClassLoader.loadClass(ClassLoader.java:562)
at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:136)
at org.codehaus.classworlds.ClassRealmImpl.loadClassDirect(ClassRealmImpl.java:262)
at org.codehaus.classworlds.ClassRealmImpl.loadClass(ClassRealmImpl.java:239)
at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:155)
at java.lang.ClassLoader.loadClass(ClassLoader.java:494)
at java.lang.ClassLoader.resolveClass0(Native Method)
at java.lang.ClassLoader.resolveClass(ClassLoader.java:920)
at java.lang.ClassLoader.loadClass(ClassLoader.java:565)
at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:136)
at org.codehaus.classworlds.ClassRealmImpl.loadClassDirect(ClassRealmImpl.java:262)
at org.codehaus.classworlds.ClassRealmImpl.loadClass(ClassRealmImpl.java:239)
at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:155)
at java.lang.ClassLoader.loadClass(ClassLoader.java:494)
at java.lang.ClassLoader.resolveClass0(Native Method)
at java.lang.ClassLoader.resolveClass(ClassLoader.java:920)
at java.lang.ClassLoader.loadClass(ClassLoader.java:565)
at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:136)
at org.codehaus.classworlds.ClassRealmImpl.loadClassDirect(ClassRealmImpl.java:262)
at org.codehaus.classworlds.ClassRealmImpl.loadClass(ClassRealmImpl.java:239)
at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:155)
at java.lang.ClassLoader.loadClass(ClassLoader.java:494)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:176)
at groovy.lang.MetaClassRegistry.class$(MetaClassRegistry.java:83)
at groovy.lang.MetaClassRegistry.<init>(MetaClassRegistry.java:83)
at groovy.lang.MetaClassRegistry.<init>(MetaClassRegistry.java:72)
at org.codehaus.groovy.runtime.Invoker.<init>(Invoker.java:83)
at at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:82).null(Unknown Source)
at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:61)
at groovy.lang.Binding.<init>(Binding.java:62)
at groovy.lang.GroovyShell.<init>(GroovyShell.java:97)
at groovy.lang.GroovyShell.main(GroovyShell.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. CONTINUUM-122 IBM'JRE : java.lang.ClassCircularityError

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Tim Ellison added a comment - 25/Mar/04 1:30 PM

Temporary work around is to add -Xverify:none to the Java command line. For the Un*x shell script it looks like this:

$ diff -c groovysh groovyte

      • groovysh Fri Mar 12 17:20:21 2004
      • groovyte Thu Mar 25 09:11:37 2004
        ***************
      • 136,140 ****
      • 136,141 ----
        -Dclassworlds.conf="$CLASSWORLDS_CONF" \
        -Dgroovy.home="$GROOVY_HOME" \
        -Dtools.jar="$TOOLS_JAR" \
        + -Xverify:none \
        org.codehaus.classworlds.Launcher "$@"
        fi
        $

and on Windows you can set the Java options environment variable before running groovysh.bat, like this:

set JAVA_OPTS=-Xverify:none

Show
Tim Ellison added a comment - 25/Mar/04 1:30 PM Temporary work around is to add -Xverify:none to the Java command line. For the Un*x shell script it looks like this: $ diff -c groovysh groovyte
      • groovysh Fri Mar 12 17:20:21 2004
      • groovyte Thu Mar 25 09:11:37 2004 ***************
      • 136,140 ****
      • 136,141 ---- -Dclassworlds.conf="$CLASSWORLDS_CONF" \ -Dgroovy.home="$GROOVY_HOME" \ -Dtools.jar="$TOOLS_JAR" \ + -Xverify:none \ org.codehaus.classworlds.Launcher "$@" fi $
and on Windows you can set the Java options environment variable before running groovysh.bat, like this: set JAVA_OPTS=-Xverify:none
Hide
Permalink
Tim Ellison added a comment - 30/Mar/04 7:27 AM

I don't have the source code for classworlds-1.0-rc2. There are no versions of classworlds on the public CVS server, and HEAD has moved on (it does not contain the source for org/codehaus/classworlds/ClassRealmImpl)

However, looking at the classworlds code that is available on CVS, the verify problem on IBM VMs is related to the custom class loader. The implementation of loadClassDirect(String) is requesting that the class be resolved eagerly, the following one-liner fixes this problem:

Index: RealmClassLoader.java
===================================================================
RCS file: /scm/cvspublic/classworlds/src/java/main/org/codehaus/classworlds/RealmClassLoader.java,v
retrieving revision 1.5
diff -u -r1.5 RealmClassLoader.java
— RealmClassLoader.java 22 Mar 2004 05:54:58 -0000 1.5
+++ RealmClassLoader.java 30 Mar 2004 11:51:05 -0000
@@ -145,7 +145,7 @@
*/
Class loadClassDirect(String name) throws ClassNotFoundException

{ - return super.loadClass( name, true ); + return super.loadClass( name, false ); }

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Regards,
Tim

Show
Tim Ellison added a comment - 30/Mar/04 7:27 AM I don't have the source code for classworlds-1.0-rc2. There are no versions of classworlds on the public CVS server, and HEAD has moved on (it does not contain the source for org/codehaus/classworlds/ClassRealmImpl) However, looking at the classworlds code that is available on CVS, the verify problem on IBM VMs is related to the custom class loader. The implementation of loadClassDirect(String) is requesting that the class be resolved eagerly, the following one-liner fixes this problem: Index: RealmClassLoader.java =================================================================== RCS file: /scm/cvspublic/classworlds/src/java/main/org/codehaus/classworlds/RealmClassLoader.java,v retrieving revision 1.5 diff -u -r1.5 RealmClassLoader.java — RealmClassLoader.java 22 Mar 2004 05:54:58 -0000 1.5 +++ RealmClassLoader.java 30 Mar 2004 11:51:05 -0000 @@ -145,7 +145,7 @@ */ Class loadClassDirect(String name) throws ClassNotFoundException { - return super.loadClass( name, true ); + return super.loadClass( name, false ); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Regards, Tim
Hide
Permalink
Mark Bluemel added a comment - 26/Apr/05 11:16 AM

This problem can be also be avoided by adding the option "-Dibm.cl.eagerresolution" to the command line.

Show
Mark Bluemel added a comment - 26/Apr/05 11:16 AM This problem can be also be avoided by adding the option "-Dibm.cl.eagerresolution" to the command line.
Hide
Permalink
blackdrag blackdrag added a comment - 01/Jun/06 12:52 PM

it seems this issue was caused by classworlds. As classworlds is no longer used in Groovy I close this bug

Show
blackdrag blackdrag added a comment - 01/Jun/06 12:52 PM it seems this issue was caused by classworlds. As classworlds is no longer used in Groovy I close this bug

People

  • Assignee:
    blackdrag blackdrag
    Reporter:
    Dolapo Falola
Vote (0)
Watch (1)

Dates

  • Created:
    17/Mar/04 10:50 PM
    Updated:
    01/Jun/06 12:52 PM
    Resolved:
    01/Jun/06 12:52 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.