harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor V. Stolyarov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3094) [classlib][luni] java.net.URL.setupStreamHandler() works incorrectly if set System property "java.protocol.handler.pkgs"
Date Wed, 31 Jan 2007 12:31:09 GMT

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

Igor V. Stolyarov commented on HARMONY-3094:
--------------------------------------------

Unit test impossibly to create because needs to pass external SystemProperty for this test.


> [classlib][luni] java.net.URL.setupStreamHandler() works incorrectly if set System property
"java.protocol.handler.pkgs"
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3094
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3094
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Igor V. Stolyarov
>         Attachments: Harmony-3094.patch
>
>
> java.net.URL.setupStreamHandler() works incorrectly if set System property "java.protocol.handler.pkgs"
> Test--------------------------------------------------------------------------
> public class Hello{
>     public static void main(String argv[]){
>         System.out.println("Hello world!");
>     }
> }
> import java.net.*;
> import java.io.*;
> public class Test{
>     public static void main(String argv[]){
>         try {
>             URL jarUrl = new URL("jar", "", -1, "file:hello.jar!/");
>             URLClassLoader ucl = new URLClassLoader(new URL[]{jarUrl});
>             URL url = ucl.getResource("Hello.class");
>             System.out.println("url = " + url); 
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>     }
> }
> Steps to reproduce:
> 1. Compile Hello.java
> 2. Create hello.jar and put Hello.class into hello.jar
> 3. Compile Test.java
> 4. run Test:   java -Djava.protocol.handler.pkgs="org.jboss.protocol" Test
> Output:
> JRockit jdk:
> C:\test>java -showversion -Djava.protocol.handler.pkgs="org.www.protocol" Test
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
>  System optimized over throughput (initial strategy singleparpar))
> url = jar:file:hello.jar!/Hello.class
> -------------------------
> Harmony:
> C:\test>java -showversion -Djava.protocol.handler.pkgs="org.www.protocol" Test
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundatio
> n or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r500207, (Jan 26 2007), Windows/ia32/msvc 1310, debug build
> http://incubator.apache.org/harmony
> java.lang.NullPointerException
>         at java.util.ResourceBundle.getBundle(ResourceBundle.java:123)
>         at org.apache.harmony.luni.util.MsgHelp$1.run(MsgHelp.java:115)
>         at java.security.AccessController.doPrivilegedImpl(Unknown Source)
>         at java.security.AccessController.doPrivileged(Unknown Source)
>         at org.apache.harmony.luni.util.MsgHelp.setLocale(MsgHelp.java:112)
>         at org.apache.harmony.luni.util.Msg.<clinit>(Msg.java:50)
>         at java.net.URL.<init>(URL.java:313)
>         at java.net.URL.<init>(URL.java)
>         at java.net.URI.toURL(URI.java:1529)
>         at java.lang.ClassLoader$SystemClassLoader.<clinit>(Unknown Source)
>         at java.lang.ClassLoader.initSystemClassLoader(Unknown Source)
>         at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
>         at java.lang.Thread.<init>(Unknown Source)
> Uncaught exception in main:
> java.lang.NoClassDefFoundError: Test
> Caused by: java.lang.ClassNotFoundException: Test
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:623)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader$SystemClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
> FAILED to invoke JVM.

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


Mime
View raw message