harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
Date Wed, 13 Dec 2006 13:23:25 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-2644?page=comments#action_12458108 ] 
            
Alexey Varlamov commented on HARMONY-2644:
------------------------------------------

This seems to be the bug of RI, for the following reasons:
1) Inconsistent behavior of user & boot classloaders;
2) General API contract of the NoClassDefFoundError is that it is thrown by VM in case resolution
error:
"Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition
of a class (as part of a normal method call or as part of creating a new instance using the
new expression) and no definition of the class could be found."
This is in contrast to contract of ClassNotFoundException:
"Thrown when an application tries to load in a class through its string name using: 
- The forName method in class Class. 
- The findSystemClass method in class ClassLoader . 
- The loadClass method in class ClassLoader. "

We may leave this is as a "Non-bug difference" until some real-world troubles encountered.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>            Priority: Minor
>         Attachments: Test.java
>
>
> DRLVM throws ClassNotFoundException instead of NoClassDefFoundError if it fails to load
class from bootclasspath.
> I did not find the exact place in specification saying it is wrong behavior, still 
> 1. JVMS operates with NoClassDefFoundError only in case the loading process failed. 
> 2. both Sun & JRockit java throws NoClassDefFoundError from the test below.
> To reproduce the issue, please do the following:
> a) compile attached Test.java (this produces Test.class, SubClass.class and SuperClass.class)
> b) remove SuperClass.class 
> c) run test with SubClass in bootclasspath, e.g.
>   
>     $ ls -1 *.class
>     Test.class SubClass.class
>     $ java -Xbootclasspath/a:. Test
> The output on Reference Implementation:
>     PASSED: got NoClassDefFoundError...
>     Note: run Test with SubClass in bootclasspath...
> The output on Harmony DRLVM (with -showversion key):
>     Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation
or its licensors, as applicable.
>     java version "1.5.0" 
>     pre-alpha : not complete or compatible
>     svn = r486063, (Dec 12 2006), Windows/ia32/msvc 1310, debug build
>     http://incubator.apache.org/harmony
>     FAILED: got ClassNotFoundException...
> Thanks
> Vladimir

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

        

Mime
View raw message