[janino-dev] [jira] Commented: (JANINO-31) IncompatibleClassChangeError when loading nested classes

View: New views
1 Messages — Rating Filter:   Alert me  

[janino-dev] [jira] Commented: (JANINO-31) IncompatibleClassChangeError when loading nested classes

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JANINO-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=145206#action_145206 ]

John V Sichi commented on JANINO-31:
------------------------------------

With Janino 2.5.15, I am getting a similar problem (IncompatibleClassChangeError, only shows up with JRockit R27.4--Sun JVM is fine).  It looks like a regression in 2.5.15, since I don't get the problem with 2.5.14.  I don't have an isolated repro yet, but I'm including the stack trace here (and attaching the code being compiled) in case anything looks familiar.

Error: java.lang.IncompatibleClassChangeError: net/sf/farrago/dynamic/stmt12/ExecutableStmt$Ojp_0 (state=,code=0)
net.sf.farrago.jdbc.FarragoJdbcUtil$FarragoSqlException: java.lang.IncompatibleClassChangeError: net/sf/farrago/dynamic/stmt12/ExecutableStmt$Ojp_0
        at java.lang.Class.getDeclaredClasses0(Native Method)
        at java.lang.Class.getDeclaredClasses(Class.java:1671)
        at org.codehaus.janino.ReflectionIClass.getDeclaredIClasses2(ReflectionIClass.java)
        at org.codehaus.janino.IClass.getDeclaredIClasses(IClass.java)
        at org.codehaus.janino.IClass.findMemberType(IClass.java)
        at org.codehaus.janino.IClass.findMemberType(IClass.java)
        at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.access$102(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler$16.visitReferenceType(UnitCompiler.java)
        at org.codehaus.janino.Java$ReferenceType.accept(Java.java)
        at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.getLocalVariable(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.buildLocalVariableMap(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.access$37(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler$6.visitLocalVariableDeclarationStatement(UnitCompiler.java)
        at org.codehaus.janino.Java$LocalVariableDeclarationStatement.accept(Java.java)
        at org.codehaus.janino.UnitCompiler.buildLocalVariableMap(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.buildLocalVariableMap(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.buildLocalVariableMap(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler$3.visitAnonymousClassDeclaration(UnitCompiler.java)
        at org.codehaus.janino.Java$AnonymousClassDeclaration.accept(Java.java)
        at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler.access$66(UnitCompiler.java)
        at org.codehaus.janino.UnitCompiler$10.visitNewAnonymousClassInstance(UnitCompiler.java)
        at org.codehaus.janino.Java$NewAnonymousClassInstance.accept(Java.java)

> IncompatibleClassChangeError when loading nested classes
> --------------------------------------------------------
>
>                 Key: JANINO-31
>                 URL: http://jira.codehaus.org/browse/JANINO-31
>             Project: Janino
>          Issue Type: Bug
>         Environment: BEA jrockit81sp3_142_04
> Janino 2.3.7
>            Reporter: kdx
>            Assignee: Arno Unkrig
>            Priority: Critical
>         Attachments: atd.patch, janinoc-incompatibleclasschangeerror-testcase.zip
>
>
> Such a class:
> public class Function_0 {
>     public static class PrintX {
>         public static void printX() {
>             System.err.println("x");
>         }
>     }
> }
> when compiled by Janino and the resulting class files loaded via the ByteArrayClassLoader like this:
> ByteArrayClassLoader bacl = new ByteArrayClassLoader(classes, parent);
> Class clazz = bacl.loadClass(classNames[0]);
> System.err.println(clazz.getDeclaredClasses());
> results in a verification error on BEA's jrockit81sp3_142_04 JVM:
> java.lang.IncompatibleClassChangeError: Function_0$PrintX
> at java.lang.Class.getDeclaredClasses0(I)[Ljava.lang.Class;(Unknown Source)
> at java.lang.Class.getDeclaredClasses(I)[Ljava.lang.Class;(Unknown Source)
> at Main.main([Ljava.lang.String;)V(Main.java:45)
> And seems to work fine on Sun's j2sdk1.4.2_04:
> [Ljava.lang.Class;@206c555
> BEA's website claims that JRockit performs stricter type checks than Sun's JVM, see "Why is JRockit throwing a ClassFormatError, IncompatibleClassChangeError or other LinkageError exceptions when the Sun JVM is not?" at http://e-docs.bea.com/wljrockit/docs81/dev_faq.html
> The attached source, when compiled by Sun's j2sdk1.4.2_04, runs fine both on the Sun j2sdk1.4.2_04 and BEA jrockit81sp3_142_04 JVMs.  When compiled by Janino 2.3.7, it runs fine on the Sun j2sdk1.4.2_04 JVM, but not, as said above, on BEA jrockit81sp3_142_04.
> To verify that it is only the nested classes that cause the problem, the Main.class may be overwritten with a Sun-compiled version (while keeping the Function_0*.class files Janino-compiled) and the IncompatibleClassChangeError still happens.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email