You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Varlamov (JIRA)" <ji...@apache.org> on 2006/11/01 14:32:16 UTC

[jira] Created: (HARMONY-2037) [drlvm][kernel] Unable to replace system class loader via cmd-line

[drlvm][kernel] Unable to replace system class loader via cmd-line
------------------------------------------------------------------

                 Key: HARMONY-2037
                 URL: http://issues.apache.org/jira/browse/HARMONY-2037
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
            Reporter: Alexey Varlamov
            Priority: Minor


The javadoc for ClassLoader.getSystemClassLoader() states that it should be possible to replace default system classloader via "java.system.class.loader" property value.
However this functionality is broken in DRLVM (since HARMONY-1582).
To reproduce:

public class CustomSysLoader extends ClassLoader {

    public static void main(String[] args) {
        ClassLoader scl = ClassLoader.getSystemClassLoader();
        System.out.println(scl);
        if (CustomSysLoader.class == scl.getClass()) {
            System.out.println("PASSED");
        } else {
            System.out.println("FAILED");
        }
    }

    public CustomSysLoader(ClassLoader parent) {
        super(parent);
    }
}

java -Djava.system.class.loader=CustomSysLoader CustomSysLoader
HMYEXEL062E Internal VM error: Failed to create Java VM
FAILED to invoke JVM.

-- 
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-2037) [drlvm][kernel] Unable to replace system class loader via cmd-line

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

Investigation shows that ExceptionInInitializerError happens:
Exception occured: java/lang/NullPointerException
exit method org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection <clinit> ()V
Stack looks like this:

si_goto_previous to ip = 0134E1FA (<init>(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;Ljava/lang/String;J)V)
si_goto_previous from ip = 0134E1FA (<init>(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;Ljava/lang/String;J)V)
si_goto_previous to ip = 0134DFF9 (<init>(Ljava/lang/Runnable;)V)
si_goto_previous from ip = 0134DFF9 (<init>(Ljava/lang/Runnable;)V)
si_goto_previous to ip = 0134DE3A (closeJars()V)
si_goto_previous from ip = 0134DE3A (closeJars()V)
si_goto_previous to ip = 0134D472 (<clinit>()V)
si_goto_previous from ip = 0134D472 (<clinit>()V)
si_goto_previous to ip = 0057D440 (M2N)
si_goto_previous from ip = 0057D440 (M2N)
si_unwind_from_m2n, ip = 0134D17D
si_goto_previous to ip = 0134D17D (openConnection(Ljava/net/URL;)Ljava/net/URLConnection;)
si_goto_previous from ip = 0134D17D (openConnection(Ljava/net/URL;)Ljava/net/URLConnection;)
si_goto_previous to ip = 0134CFBC (openConnection()Ljava/net/URLConnection;)
si_goto_previous from ip = 0134CFBC (openConnection()Ljava/net/URLConnection;)
si_goto_previous to ip = 0134B1D2 (findClassImpl([Ljava/net/URL;Ljava/lang/String;)Ljava/lang/Class;)
si_goto_previous from ip = 0134B1D2 (findClassImpl([Ljava/net/URL;Ljava/lang/String;)Ljava/lang/Class;)
si_goto_previous to ip = 0134A35C (run()Ljava/lang/Class;)
si_goto_previous from ip = 0134A35C (run()Ljava/lang/Class;)
si_goto_previous to ip = 0134A2A5 (run()Ljava/lang/Object;)
si_goto_previous from ip = 0134A2A5 (run()Ljava/lang/Object;)
si_goto_previous to ip = 012E7211 (doPrivilegedImpl(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;)
si_goto_previous from ip = 012E7211 (doPrivilegedImpl(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;)
si_goto_previous to ip = 0134A1FF (doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;)
si_goto_previous from ip = 0134A1FF (doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;)
si_goto_previous to ip = 01349F4B (findClass(Ljava/lang/String;)Ljava/lang/Class;)
si_goto_previous from ip = 01349F4B (findClass(Ljava/lang/String;)Ljava/lang/Class;)
si_goto_previous to ip = 0134989D (loadClass(Ljava/lang/String;Z)Ljava/lang/Class;)
si_goto_previous from ip = 0134989D (loadClass(Ljava/lang/String;Z)Ljava/lang/Class;)
si_goto_previous to ip = 013496F9 (loadClass(Ljava/lang/String;Z)Ljava/lang/Class;)
si_goto_previous from ip = 013496F9 (loadClass(Ljava/lang/String;Z)Ljava/lang/Class;)
si_goto_previous to ip = 0134951E (loadClass(Ljava/lang/String;)Ljava/lang/Class;)
si_goto_previous from ip = 0134951E (loadClass(Ljava/lang/String;)Ljava/lang/Class;)
si_goto_previous to ip = 012EB2F6 (initSystemClassLoader()V)
si_goto_previous from ip = 012EB2F6 (initSystemClassLoader()V)
si_goto_previous to ip = 012EADE3 (getSystemClassLoader()Ljava/lang/ClassLoader;)
si_goto_previous from ip = 012EADE3 (getSystemClassLoader()Ljava/lang/ClassLoader;)
si_goto_previous to ip = 012D73BF (<init>(Ljava/lang/ThreadGroup;Ljava/lang/String;JJIZ)V)
si_goto_previous from ip = 012D73BF (<init>(Ljava/lang/ThreadGroup;Ljava/lang/String;JJIZ)V)


> [drlvm][kernel] Unable to replace system class loader via cmd-line
> ------------------------------------------------------------------
>
>                 Key: HARMONY-2037
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2037
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>            Priority: Minor
>
> The javadoc for ClassLoader.getSystemClassLoader() states that it should be possible to replace default system classloader via "java.system.class.loader" property value.
> However this functionality is broken in DRLVM (since HARMONY-1582).
> To reproduce:
> public class CustomSysLoader extends ClassLoader {
>     public static void main(String[] args) {
>         ClassLoader scl = ClassLoader.getSystemClassLoader();
>         System.out.println(scl);
>         if (CustomSysLoader.class == scl.getClass()) {
>             System.out.println("PASSED");
>         } else {
>             System.out.println("FAILED");
>         }
>     }
>     public CustomSysLoader(ClassLoader parent) {
>         super(parent);
>     }
> }
> java -Djava.system.class.loader=CustomSysLoader CustomSysLoader
> HMYEXEL062E Internal VM error: Failed to create Java VM
> FAILED to invoke JVM.

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