harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Pervov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4043) [classlib][luni]Unexpected error message printed in console when searching custom system class loader in missing jar
Date Wed, 18 Jul 2007 12:42:05 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12513548

Pavel Pervov commented on HARMONY-4043:

The problem is in org.apache.harmony.<module>.internal.nls.Messages.java classes which
have the same construct in their setLocale methods:
            final ClassLoader loader = VM.bootCallerClassLoader();
            return (ResourceBundle) AccessController
                    .doPrivileged(new PrivilegedAction<Object>() {
                        public Object run() {
                            return ResourceBundle.getBundle(resource, locale,
                                    loader != null ? loader : ClassLoader.getSystemClassLoader());
As DRLVM do not have java object for bootstrap class loader, VM.bootCallerClassLoader() returns
null and a call to ClassLoader.getSystemClassLoader() is being made. Semantically, these two
are different calls and return different class loaders with different available classes.

I couldn't construct the way to force ResourceBundle to get bundle from bootstrap class loader
- this is what required in the context of this method.

> [classlib][luni]Unexpected error message printed in console when searching custom system
class loader in missing jar
> --------------------------------------------------------------------------------------------------------------------
>                 Key: HARMONY-4043
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4043
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sergey Salishev
>            Priority: Minor
> When running drlvm the following command line:
> java -classpath dummy.jar;. -Djava.system.class.loader=ClassLoader bla
> the following exception is printed in console:
> java.lang.IllegalStateException: Recursive invocation while initializing system class
>         at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:667)
>         at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:159)
>         at org.apache.harmony.luni.util.MsgHelp$1.run(MsgHelp.java:115)
>         at java.security.AccessController.doPrivilegedImpl(AccessController.java:171)
>         at java.security.AccessController.doPrivileged(AccessController.java:53)
>         at org.apache.harmony.luni.util.MsgHelp.setLocale(MsgHelp.java:112)
>         at org.apache.harmony.luni.util.Msg.<clinit>(Msg.java:49)
>         at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.findJarFile(JarURLConnection.java:196)
>         at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:161)
>         at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:178)
>         at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1078)
>         at java.net.URLClassLoader$4.run(URLClassLoader.java:625)
>         at java.net.URLClassLoader$4.run(URLClassLoader.java:1)
>         at java.security.AccessController.doPrivilegedImpl(AccessController.java:171)
>         at java.security.AccessController.doPrivileged(AccessController.java:64)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:627)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:570)
>         at java.lang.ClassLoader$SystemClassLoader.loadClass(ClassLoader.java:958)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
>         at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:699)
>         at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:159) 
> Here dummy.jar is noexistent and ClassLoader is any custom class loader class.
> If ClassLoader also doesn't exist the VM crashes with this command line. But the error
message is peinted anyway.
> If the class loader class exists the execution continues as expected.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message