You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vladimir Beliaev (JIRA)" <ji...@apache.org> on 2006/12/12 14:22:23 UTC

[jira] Created: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

[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


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

        

[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470522 ] 

Alexey Varlamov commented on HARMONY-2644:
------------------------------------------

Yes, it prints with and w/o patch applied:
FAILED: got ClassNotFoundException...
FAILED: got ClassNotFoundException...

Looking into the patch, you dropped code which cleans exception in native but added catching NoClassDefFoundError in Java - so it works as expected :)


> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2644?page=comments#action_12461369 ] 
            
Pavel Pervov commented on HARMONY-2644:
---------------------------------------

Ofter thinking a bit I can come out with the rationale for throwing NoClassDefFoundError instead of ClassNotFoundException: every attempt to load class through VM (either resolution, or array construction, or loading ancestor classes - super class and super interfaces) should produce NoClassDefFoundError if bytes for a class was not found. Otherwise, ClassNotFoundException is thrown.

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

        

[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12478826 ] 

Vasily Zakharov commented on HARMONY-2644:
------------------------------------------

Thanks Alexey, my issue is now resolved.


> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: add_thread_local_flag_20070222.patch, cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Varlamov updated HARMONY-2644:
-------------------------------------

    Attachment: cloading.diff

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2644?page=comments#action_12458443 ] 
            
Alexey Varlamov commented on HARMONY-2644:
------------------------------------------

Yes, this was in my todo list for a long. So patch is welcome, the same as the additional test :)

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

        

[jira] Updated: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Pervov updated HARMONY-2644:
----------------------------------

    Attachment: H2846.patch

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>            Priority: Minor
>         Attachments: H2846.patch, 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: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483197 ] 

Vasily Zakharov commented on HARMONY-2644:
------------------------------------------

Vladimir and Alexey, could someone of you please close this issue?


> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: add_thread_local_flag_20070222.patch, cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467818 ] 

Alexey Varlamov commented on HARMONY-2644:
------------------------------------------

Pavel, EHWA stops passing (on SUSE9, both ia32 and x64) with the patch applied - unfortunately I had no time to investigate. 
And, please consider adding testcase in regression suite format.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470873 ] 

Alexey Varlamov commented on HARMONY-2644:
------------------------------------------

Well, for me it looks like move in right direction :)
I extended the patch, to address the api2vm inconsistency we talked above, please review.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2644?page=comments#action_12458148 ] 
            
Pavel Pervov commented on HARMONY-2644:
---------------------------------------

Although this test produces NoClassDefFoundError from bootstrap class loader, we may rewrite it to produce VerifyError. In this case, RIs will throw VerifyError, but our implementation will still throw ClassNotFoundException, hiding original cause of the failure.

I was always curious why java/lang/VMClassRegistry.findLoadedClass has ambiguous contract for user class loader and for bootstrap class loader. For user class loader it only tries to locate classes which are already loaded in that class loader. For bootstrap class loader it not only looks up a class, but tries to load it if lookup failed.

I suggest separating these two functionalities for bootstrap class loader rewriting implementation of kernel classes accordingly. This will fix reported issue.

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

        

[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470526 ] 

Pavel Pervov commented on HARMONY-2644:
---------------------------------------

You are absolutely right and this is absolutely wrong. :)
Will look into this again.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470943 ] 

Alexey Varlamov commented on HARMONY-2644:
------------------------------------------

Yes, this is reasonable solution - go for it (let's use my patch as basis). I recall there is somewhat related HARMONY-3074, so it is reasonable to introduce classloading TL structure.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] Updated: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Vladimir Beliaev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladimir Beliaev updated HARMONY-2644:
--------------------------------------

    Patch Info: [Patch Available]

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>            Priority: Minor
>         Attachments: H2846.patch, 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: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470190 ] 

Pavel Pervov commented on HARMONY-2644:
---------------------------------------

EHWA works for me on both Linuxes: ia32 and x86-64.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Vladimir Beliaev (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2644?page=all ]

Vladimir Beliaev updated HARMONY-2644:
--------------------------------------

    Attachment: Test.java

The issue reproducer.

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

        

[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470519 ] 

Pavel Pervov commented on HARMONY-2644:
---------------------------------------

Try running this test with the following command line:
$HY_HOME/bin/java -Xbootclasspath/a:. Test

on RI and on DRLVM without the patch and with the patch applied and see the difference.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12478421 ] 

Vasily Zakharov commented on HARMONY-2644:
------------------------------------------

The fix made breaks the arrays loading. Here's the simple test demonstrating that:

public class Test {
    public static void main(String args[]) throws Exception {
        Class.forName("[LA;");
        System.out.println("SUCCESS");
    }

}

class A {
}

Output on RI and IBM VM:

SUCCESS

Output on DRL VM:

java.lang.ClassNotFoundException: [LA;
        at java.net.URLClassLoader.findClass(URLClassLoader.java:630)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:552)
        at java.lang.ClassLoader$SystemClassLoader.loadClass(ClassLoader.java:937)
        at java.lang.ClassLoader.loadClass(ClassLoader.java)
        at java.lang.Class.forName(Class.java:153)
        at java.lang.Class.forName(Class.java:128)
        at Test.main(Test.java:3)

It took 4 hours to localize this error from Netbeans runs.


> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: add_thread_local_flag_20070222.patch, cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Varlamov reassigned HARMONY-2644:
----------------------------------------

    Assignee: Alexey Varlamov

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: H2846.patch, 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: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Varlamov resolved HARMONY-2644.
--------------------------------------

    Resolution: Fixed

Vera,
the patch you suggested broke few pre-commit tests, due to the following:
1) in vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java
-                try {
-                    clazz = parentClassLoader.loadClass(name);
-                } catch (ClassNotFoundException e) {
-                }
+                clazz = parentClassLoader.loadClass(name);
This violates delegation model, "this" classloader never got a chance to findClass until parent is bootstrap loader;
2) The TLS flag is only reset if class is actually found and successfully defined. So if e.g. it's classdata is corrupt the flag still indicates that classloading should continue and ClassFormatError is reset, this is invalid behavior.

I fixed all of the above problems and brushed related api2vm functions, integrated to SVN at r513313.
Please verify.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: add_thread_local_flag_20070222.patch, cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470545 ] 

Pavel Pervov commented on HARMONY-2644:
---------------------------------------

Please, hold on with committing this. This fix seems to be wrong at all... :(

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470505 ] 

Alexey Varlamov commented on HARMONY-2644:
------------------------------------------

Pavel, the Eclipse issue has gone for me too. 
I'm just confused: the patch actually fixes HARMONY-2846 (as its name hints) but does not change behaviour for this issue. 
AFAIU the complete fix must be done on VM side, to differentiate between classloading requests coming from API and usual resolution requests, so it will throw ClassNotFoundException and NoClassDefFoundError respectively.

So I'm going to proceed with fixing HARMONY-2846 and leave this one open.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Vladimir Beliaev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladimir Beliaev reopened HARMONY-2644:
---------------------------------------

    Estimated Complexity: Moderate

I reopen this issue based on input from Vasily.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: add_thread_local_flag_20070222.patch, cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Varlamov resolved HARMONY-2644.
--------------------------------------

    Resolution: Fixed

Err, I was too eager cleaning api2vm. In fact I already evaluated exactly these same rakes (HARMONY-1624), but forgot about it - there is subtle difference between user and system classes.
Fixed at r515482 and added a regression testcase to org.apache.harmony.luni.tests.java.lang.ClassTest.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: add_thread_local_flag_20070222.patch, cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Varlamov closed HARMONY-2644.
------------------------------------


Closed

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: add_thread_local_flag_20070222.patch, cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Vera Volynets (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vera Volynets updated HARMONY-2644:
-----------------------------------

    Attachment: add_thread_local_flag_20070222.patch

This patch is compiled from previous cloading.patch.
I only add flag is_original to VM_thread.
So now fo Class.forName(str) method right exception for different situation is thrown.
This flag is set when original class is loaded through Java_java_lang_VMClassRegistry_loadBootstrapClass and reserted if class needs to load ancestors.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: add_thread_local_flag_20070222.patch, cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470937 ] 

Pavel Pervov commented on HARMONY-2644:
---------------------------------------

Your patch is cleaner but it does exactly the same thing as original patch did.

What is required to do here is to differentiate the reason of loading failure in bootstrap class loader: bytes for requested class are not found OR bytes for one of its predecessors are missing. The first case throws ClassNotFoundException from Class.forName, the second - NoClassDefFoundError.

The only way I see here is to keep some thread local flag along with raised NoClassDefFoundError and exn_clear() in VMClassRegistry.findLoadedClass (loadBootstrapClass in your patch) if this flag is set.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: cloading.diff, H2846.patch, 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.
-
You can reply to this email to add a comment to the issue online.