You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Leo Li (JIRA)" <ji...@apache.org> on 2007/03/20 02:53:32 UTC

[jira] Created: (HARMONY-3431) [classlib][luni]java.net.JarURLConnection of the same URL should contains the same JarFile.

[classlib][luni]java.net.JarURLConnection of the same URL should contains the same JarFile.
-------------------------------------------------------------------------------------------

                 Key: HARMONY-3431
                 URL: https://issues.apache.org/jira/browse/HARMONY-3431
             Project: Harmony
          Issue Type: Bug
            Reporter: Leo Li


Here is an example:

 public void testJarURLConnection_getJarFile() throws Exception
    {
        URL url1 = new URL("jar:file:D:/test.jar/Test.class");
        JarURLConnection connection1 = (JarURLConnection) url1.openConnection();
        JarURLConnection connection2 = (JarURLConnection) url1.openConnection();
        URL url2 = new URL("jar:file:D:/test.jar/Test.class");
        JarURLConnection connection3 = (JarURLConnection) url2.openConnection();
        assertSame(connection1.getJarFile(), connection2.getJarFile());
        assertSame(connection1.getJarFile(), connection3.getJarFile());            
    }

RI passes.
Harmony fails.

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


[jira] Commented: (HARMONY-3431) [classlib][luni]java.net.JarURLConnection fails to get certificates.

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

Mikhail Markov commented on HARMONY-3431:
-----------------------------------------

Hi, Leo,

I've used the correct url pointing to the bcprov and it works for me on Harmony - I've got 2 X.509 certificates.

If i remove bcprov.jar file from jdk/jre/lib/ext directory then i've got:
java.io.FileNotFoundException: JAR entry org/bouncycastle/asn1/DEREnumerated.class not found in C:/jdk/harmony/svn/enhanced/classlib/trunk/deploy/jdk/jre/lib/ext/bcprov.jar

Is that what you mean?

Thanks, Mikhail

> [classlib][luni]java.net.JarURLConnection fails to get certificates.
> --------------------------------------------------------------------
>
>                 Key: HARMONY-3431
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3431
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>
> Here is an example:
>  public void test() throws Exception
>     {
>         URL url = new URL("jar:file:D:/workspaces/workspace/harmony/deploy/jdk/jre/lib/ext/bcprov.jar!/org/bouncycastle/asn1/DEREnumerated.class");
>         JarURLConnection connection = (JarURLConnection) url.openConnection();
>         InputStream in = connection.getInputStream();
>         byte[] data = new byte[1024];
>         while(in.read(data)>=0);
>         in.close();
>         assertNotNull(connection.getCertificates());        
>     }
> RI passes.
> Harmony fails.

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


[jira] Commented: (HARMONY-3431) [classlib][luni]java.net.JarURLConnection fails to get certificates.

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

Leo Li commented on HARMONY-3431:
---------------------------------

Hi,Mikhail:
     I can  still reproduce it on my machine.:(
Good luck!
Leo

> [classlib][luni]java.net.JarURLConnection fails to get certificates.
> --------------------------------------------------------------------
>
>                 Key: HARMONY-3431
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3431
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>
> Here is an example:
>  public void test() throws Exception
>     {
>         URL url = new URL("jar:file:D:/workspaces/workspace/harmony/deploy/jdk/jre/lib/ext/bcprov.jar!/org/bouncycastle/asn1/DEREnumerated.class");
>         JarURLConnection connection = (JarURLConnection) url.openConnection();
>         InputStream in = connection.getInputStream();
>         byte[] data = new byte[1024];
>         while(in.read(data)>=0);
>         in.close();
>         assertNotNull(connection.getCertificates());        
>     }
> RI passes.
> Harmony fails.

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


[jira] Updated: (HARMONY-3431) [classlib][luni]java.net.JarURLConnection fails to get certificates.

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

Leo Li updated HARMONY-3431:
----------------------------

    Description: 
Here is an example:

 public void test() throws Exception
    {
        URL url = new URL("jar:file:D:/workspaces/workspace/harmony/deploy/jdk/jre/lib/ext/bcprov.jar!/org/bouncycastle/asn1/DEREnumerated.class");
        JarURLConnection connection = (JarURLConnection) url.openConnection();
        InputStream in = connection.getInputStream();
        byte[] data = new byte[1024];
        while(in.read(data)>=0);
        in.close();
        assertNotNull(connection.getCertificates());        
    }
RI passes.
Harmony fails.

  was:
Here is an example:

 public void testJarURLConnection_getJarFile() throws Exception
    {
        URL url1 = new URL("jar:file:D:/test.jar/Test.class");
        JarURLConnection connection1 = (JarURLConnection) url1.openConnection();
        JarURLConnection connection2 = (JarURLConnection) url1.openConnection();
        URL url2 = new URL("jar:file:D:/test.jar/Test.class");
        JarURLConnection connection3 = (JarURLConnection) url2.openConnection();
        assertSame(connection1.getJarFile(), connection2.getJarFile());
        assertSame(connection1.getJarFile(), connection3.getJarFile());            
    }

RI passes.
Harmony fails.

        Summary: [classlib][luni]java.net.JarURLConnection fails to get certificates.  (was: [classlib][luni]java.net.JarURLConnection of the same URL should contains the same JarFile.)

> [classlib][luni]java.net.JarURLConnection fails to get certificates.
> --------------------------------------------------------------------
>
>                 Key: HARMONY-3431
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3431
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Leo Li
>
> Here is an example:
>  public void test() throws Exception
>     {
>         URL url = new URL("jar:file:D:/workspaces/workspace/harmony/deploy/jdk/jre/lib/ext/bcprov.jar!/org/bouncycastle/asn1/DEREnumerated.class");
>         JarURLConnection connection = (JarURLConnection) url.openConnection();
>         InputStream in = connection.getInputStream();
>         byte[] data = new byte[1024];
>         while(in.read(data)>=0);
>         in.close();
>         assertNotNull(connection.getCertificates());        
>     }
> RI passes.
> Harmony fails.

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


[jira] Commented: (HARMONY-3431) [classlib][luni]java.net.JarURLConnection fails to get certificates.

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

Mikhail Markov commented on HARMONY-3431:
-----------------------------------------

Leo, is this issue still actual for you - I still could not reproduce it?


> [classlib][luni]java.net.JarURLConnection fails to get certificates.
> --------------------------------------------------------------------
>
>                 Key: HARMONY-3431
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3431
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>
> Here is an example:
>  public void test() throws Exception
>     {
>         URL url = new URL("jar:file:D:/workspaces/workspace/harmony/deploy/jdk/jre/lib/ext/bcprov.jar!/org/bouncycastle/asn1/DEREnumerated.class");
>         JarURLConnection connection = (JarURLConnection) url.openConnection();
>         InputStream in = connection.getInputStream();
>         byte[] data = new byte[1024];
>         while(in.read(data)>=0);
>         in.close();
>         assertNotNull(connection.getCertificates());        
>     }
> RI passes.
> Harmony fails.

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


[jira] Commented: (HARMONY-3431) [classlib][luni]java.net.JarURLConnection fails to get certificates.

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

Leo Li commented on HARMONY-3431:
---------------------------------

Hi, Mikhail:
      Besides, in order to reproduce the problem, the testcase must run stand-alone, that is, no other actions that might lead to load security providers shall begin before the testcase.
       I believe, it is a bootstrap problem of loading security provider.  Harmony needs a solution for it and I am now searching for a way.

Good luck!
Leo.

> [classlib][luni]java.net.JarURLConnection fails to get certificates.
> --------------------------------------------------------------------
>
>                 Key: HARMONY-3431
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3431
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>
> Here is an example:
>  public void test() throws Exception
>     {
>         URL url = new URL("jar:file:D:/workspaces/workspace/harmony/deploy/jdk/jre/lib/ext/bcprov.jar!/org/bouncycastle/asn1/DEREnumerated.class");
>         JarURLConnection connection = (JarURLConnection) url.openConnection();
>         InputStream in = connection.getInputStream();
>         byte[] data = new byte[1024];
>         while(in.read(data)>=0);
>         in.close();
>         assertNotNull(connection.getCertificates());        
>     }
> RI passes.
> Harmony fails.

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


[jira] Commented: (HARMONY-3431) [classlib][luni]java.net.JarURLConnection fails to get certificates.

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

Leo Li commented on HARMONY-3431:
---------------------------------

Hi, Mikhail:
      Excuse me if I am confusing you.
      The URL should point to the bcprov which is used as the security provider for Harmony.
      It is also a bootstrap problem for security provider. One of my suggestion is that, use an built-in security provider in bootstrap, that is, in JarVerifier,  we just load the specified provider class and get some security tools just from it, and do not use the normal load mechanism in security module in order to avoid the "chicken and egg "problem.


Good luck!
Leo.


> [classlib][luni]java.net.JarURLConnection fails to get certificates.
> --------------------------------------------------------------------
>
>                 Key: HARMONY-3431
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3431
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>
> Here is an example:
>  public void test() throws Exception
>     {
>         URL url = new URL("jar:file:D:/workspaces/workspace/harmony/deploy/jdk/jre/lib/ext/bcprov.jar!/org/bouncycastle/asn1/DEREnumerated.class");
>         JarURLConnection connection = (JarURLConnection) url.openConnection();
>         InputStream in = connection.getInputStream();
>         byte[] data = new byte[1024];
>         while(in.read(data)>=0);
>         in.close();
>         assertNotNull(connection.getCertificates());        
>     }
> RI passes.
> Harmony fails.

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


[jira] Commented: (HARMONY-3431) [classlib][luni]java.net.JarURLConnection fails to get certificates.

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

Mikhail Markov commented on HARMONY-3431:
-----------------------------------------

I could not reproduce the problem on recent svn snapshot both on J9 and DRLVM on WinXP.
Could anyone else reproduce it?

> [classlib][luni]java.net.JarURLConnection fails to get certificates.
> --------------------------------------------------------------------
>
>                 Key: HARMONY-3431
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3431
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>
> Here is an example:
>  public void test() throws Exception
>     {
>         URL url = new URL("jar:file:D:/workspaces/workspace/harmony/deploy/jdk/jre/lib/ext/bcprov.jar!/org/bouncycastle/asn1/DEREnumerated.class");
>         JarURLConnection connection = (JarURLConnection) url.openConnection();
>         InputStream in = connection.getInputStream();
>         byte[] data = new byte[1024];
>         while(in.read(data)>=0);
>         in.close();
>         assertNotNull(connection.getCertificates());        
>     }
> RI passes.
> Harmony fails.

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