[janino-dev] [jira] Created: (JANINO-109) Rule compilation incorrectly fails with racle.classloader.util.AnnotatedNoClassDefFoundError logged

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

[janino-dev] [jira] Created: (JANINO-109) Rule compilation incorrectly fails with racle.classloader.util.AnnotatedNoClassDefFoundError logged

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

Reply to Author | View Threaded | Show Only this Message

Rule compilation incorrectly fails with racle.classloader.util.AnnotatedNoClassDefFoundError logged
---------------------------------------------------------------------------------------------------

                 Key: JANINO-109
                 URL: http://jira.codehaus.org/browse/JANINO-109
             Project: Janino
          Issue Type: Bug
         Environment: Janino 2.5.10, Windows Vista, jdk1.5.0_13, Oracle JDeveloper 10.1.3.2.0.4066
            Reporter: Keith Clarke
            Assignee: Arno Unkrig


This problem may be limited to this combination of circumstancesL

- when running Oracle's OC4J application server
- when a class referenced by a rule has the same name (casing excepted) as a package

The stack trace is below. A local fix that works for us is to modify ClassLoaderIClassLoader.findIClass to return null when a NoClassDefFoundError is thrown from Class.forName.



08/04/21 09:55:04 oracle.classloader.util.AnnotatedNoClassDefFoundError:

Missing class: com.claimvantage.adf.base.entity (wrong name: com.claimvantage.adf.base.Entity)

Dependent class: com.claimvantage.adf.base.entity
Loader: current-workspace-app.web.cv-std:0.0.0
Code-Source: /C:/ClaimProduct/BaseModel/classes/
Configuration: <classpath> in C:\ClaimProduct\StdViewController\public_html

The missing class is not available from any code-source or loader in the system.
08/04/21 09:55:05 at oracle.classloader.PolicyClassLoader.defineClass(PolicyClassLoader.java:2264)
at oracle.classloader.PolicyClassLoader.findLocalClass(PolicyClassLoader.java:1462)
at oracle.classloader.SearchPolicy$FindLocal.getClass(SearchPolicy.java:167)
at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1674)
at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1635)
at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1620)
at org.drools.rule.PackageCompilationData$PackageClassLoader.loadClass(PackageCompilationData.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.codehaus.janino.ClassLoaderIClassLoader.findIClass(ClassLoaderIClassLoader.java)
at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java)
at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java)
at org.codehaus.janino.UnitCompiler.reclassifyName(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.access$9100(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler$15.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.access$12700(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler$30.getParameterTypes(UnitCompiler.java)
at org.codehaus.janino.IClass$IMethod.getDescriptor(IClass.java)
at org.codehaus.janino.IClass.getIMethods(IClass.java)
at org.codehaus.janino.IClass.getIMethods(IClass.java)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java)
at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java)
at org.codehaus.janino.Compiler.compile(Compiler.java)
at org.drools.commons.jci.compilers.JaninoJavaCompiler.compile(JaninoJavaCompiler.java:174)
at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51)
at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:332)

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



[janino-dev] [jira] Resolved: (JANINO-109) Rule compilation incorrectly fails with racle.classloader.util.AnnotatedNoClassDefFoundError logged

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

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JANINO-109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arno Unkrig resolved JANINO-109.
--------------------------------

    Resolution: Won't Fix

Hi Keith,

to me it seems like "oracle.classloader.PolicyClassLoader" were buggy: It finds the class file in some case-insensitive manner, and then calls "ClassLoad.defineClass(name, byte[], off, len)", which then, as documented in the JDK JAVADOC, throws a "NoClassDefFoundError - If name is not equal to the binary name of the class specified by b".

I would recommend that "oracle.classloader.PolicyClassLoader" better call "ClassLoad.defineClass(name=null, byte[], off, len)", and then check whether the class can then be loader through the ClassLoader with its PRECISE (case-sensitive) name.

BTW, JANINO has a similar problem when loading source code: Assume you want to get the source code for "a.b.c.Xyz", you open file "mysrc/a/b/c/Xyz.java", which (on a case-insensitive file system) opens "mysrc/a/b/c/XyZ.java", which declares a type "XyZ". You call "ClassLoader.defineClass(name=Xyz, byte[])", and... boom - you get the NoClassDefFoundError. Janino fixes this by first checking that the declared class's IS "Xyz", but "oracle.classloader.PolicyClassLoader" soesn't seem to do that.

Can you fix the "oracle.classloader.PolicyClassLoader" in the described manner?

Sorry I don't like your fix, because it masks the REAL NoClassDefFoundErrors and may lead to mysterious behavior. It may be a suitable workaround for you, but is not generally acceptable.

Please comment and re-open.

CU

Arno

> Rule compilation incorrectly fails with racle.classloader.util.AnnotatedNoClassDefFoundError logged
> ---------------------------------------------------------------------------------------------------
>
>                 Key: JANINO-109
>                 URL: http://jira.codehaus.org/browse/JANINO-109
>             Project: Janino
>          Issue Type: Bug
>         Environment: Janino 2.5.10, Windows Vista, jdk1.5.0_13, Oracle JDeveloper 10.1.3.2.0.4066
>            Reporter: Keith Clarke
>            Assignee: Arno Unkrig
>
> This problem may be limited to this combination of circumstancesL
> - when running Oracle's OC4J application server
> - when a class referenced by a rule has the same name (casing excepted) as a package
> The stack trace is below. A local fix that works for us is to modify ClassLoaderIClassLoader.findIClass to return null when a NoClassDefFoundError is thrown from Class.forName.
> 08/04/21 09:55:04 oracle.classloader.util.AnnotatedNoClassDefFoundError:
> Missing class: com.claimvantage.adf.base.entity (wrong name: com.claimvantage.adf.base.Entity)
> Dependent class: com.claimvantage.adf.base.entity
> Loader: current-workspace-app.web.cv-std:0.0.0
> Code-Source: /C:/ClaimProduct/BaseModel/classes/
> Configuration: <classpath> in C:\ClaimProduct\StdViewController\public_html
> The missing class is not available from any code-source or loader in the system.
> 08/04/21 09:55:05 at oracle.classloader.PolicyClassLoader.defineClass(PolicyClassLoader.java:2264)
> at oracle.classloader.PolicyClassLoader.findLocalClass(PolicyClassLoader.java:1462)
> at oracle.classloader.SearchPolicy$FindLocal.getClass(SearchPolicy.java:167)
> at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
> at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1674)
> at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1635)
> at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1620)
> at org.drools.rule.PackageCompilationData$PackageClassLoader.loadClass(PackageCompilationData.java:358)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:242)
> at org.codehaus.janino.ClassLoaderIClassLoader.findIClass(ClassLoaderIClassLoader.java)
> at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java)
> at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java)
> at org.codehaus.janino.UnitCompiler.reclassifyName(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler.access$9100(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler$15.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.access$12700(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler$30.getParameterTypes(UnitCompiler.java)
> at org.codehaus.janino.IClass$IMethod.getDescriptor(IClass.java)
> at org.codehaus.janino.IClass.getIMethods(IClass.java)
> at org.codehaus.janino.IClass.getIMethods(IClass.java)
> at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java)
> at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java)
> at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java)
> at org.codehaus.janino.Compiler.compile(Compiler.java)
> at org.drools.commons.jci.compilers.JaninoJavaCompiler.compile(JaninoJavaCompiler.java:174)
> at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51)
> at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:332)

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



[janino-dev] [jira] Commented: (JANINO-109) Rule compilation incorrectly fails with racle.classloader.util.AnnotatedNoClassDefFoundError logged

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

Reply to Author | View Threaded | Show Only this Message


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

Keith Clarke commented on JANINO-109:
-------------------------------------

Hi Arno,

I understand your position on this.

The "oracle.classloader.PolicyClassLoader" is unfortunately the class loader used for WAR files in Oracle's OC4J application server so I suspect that Oracle will be reluctant to make the fix and risk breaking existing WAR files that rely on it (even though its pretty obviously a bug). And there are the other problems of timing and what versions of the product they would fix.

So I guess we'll go with the local fix.

Thanks for your help,
Keith

> Rule compilation incorrectly fails with racle.classloader.util.AnnotatedNoClassDefFoundError logged
> ---------------------------------------------------------------------------------------------------
>
>                 Key: JANINO-109
>                 URL: http://jira.codehaus.org/browse/JANINO-109
>             Project: Janino
>          Issue Type: Bug
>         Environment: Janino 2.5.10, Windows Vista, jdk1.5.0_13, Oracle JDeveloper 10.1.3.2.0.4066
>            Reporter: Keith Clarke
>            Assignee: Arno Unkrig
>
> This problem may be limited to this combination of circumstancesL
> - when running Oracle's OC4J application server
> - when a class referenced by a rule has the same name (casing excepted) as a package
> The stack trace is below. A local fix that works for us is to modify ClassLoaderIClassLoader.findIClass to return null when a NoClassDefFoundError is thrown from Class.forName.
> 08/04/21 09:55:04 oracle.classloader.util.AnnotatedNoClassDefFoundError:
> Missing class: com.claimvantage.adf.base.entity (wrong name: com.claimvantage.adf.base.Entity)
> Dependent class: com.claimvantage.adf.base.entity
> Loader: current-workspace-app.web.cv-std:0.0.0
> Code-Source: /C:/ClaimProduct/BaseModel/classes/
> Configuration: <classpath> in C:\ClaimProduct\StdViewController\public_html
> The missing class is not available from any code-source or loader in the system.
> 08/04/21 09:55:05 at oracle.classloader.PolicyClassLoader.defineClass(PolicyClassLoader.java:2264)
> at oracle.classloader.PolicyClassLoader.findLocalClass(PolicyClassLoader.java:1462)
> at oracle.classloader.SearchPolicy$FindLocal.getClass(SearchPolicy.java:167)
> at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
> at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1674)
> at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1635)
> at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1620)
> at org.drools.rule.PackageCompilationData$PackageClassLoader.loadClass(PackageCompilationData.java:358)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:242)
> at org.codehaus.janino.ClassLoaderIClassLoader.findIClass(ClassLoaderIClassLoader.java)
> at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java)
> at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java)
> at org.codehaus.janino.UnitCompiler.reclassifyName(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler.access$9100(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler$15.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.access$12700(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler$30.getParameterTypes(UnitCompiler.java)
> at org.codehaus.janino.IClass$IMethod.getDescriptor(IClass.java)
> at org.codehaus.janino.IClass.getIMethods(IClass.java)
> at org.codehaus.janino.IClass.getIMethods(IClass.java)
> at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java)
> at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java)
> at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
> at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java)
> at org.codehaus.janino.Compiler.compile(Compiler.java)
> at org.drools.commons.jci.compilers.JaninoJavaCompiler.compile(JaninoJavaCompiler.java:174)
> at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51)
> at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:332)

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