harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-5779) java.io.FileNotFoundException Issue with file://localhost
Date Wed, 23 Apr 2008 13:29:21 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-5779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tim Ellison updated HARMONY-5779:
---------------------------------

    Attachment: harmony-5779-tim.diff

Thanks Sean, but I don't think that it is enough to just ignore the hostname.

If you change the test case given so the hostname is not "localhost" but "anything" then you'll
see that the URL connection tries to open a FTP connection!  Yes, even for the file: protocol!

I've augmented your patch with this additional behavior.  Please take a look and see what
you think.  The RI may do more that I'm unaware of and I'll keep testing to see if I can discover
more (it's unspec'ed afaik).


> java.io.FileNotFoundException Issue with file://localhost
> ---------------------------------------------------------
>
>                 Key: HARMONY-5779
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5779
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Davanum Srinivas
>            Assignee: Tim Ellison
>         Attachments: harmony-5779-tim.diff, Harmony-5779.diff
>
>
> Stack trace
> [dims@dims-desktop test]$java -cp . HarmonyFileLocalhost
> Uncaught exception in main:
> java.io.FileNotFoundException: /localhost/home/dims/harmony/test/./HarmonyFileLocalhost.java
>         at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:235)
>         at java.io.FileInputStream.<init>(FileInputStream.java:76)
>         at org.apache.harmony.luni.internal.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:88)
>         at org.apache.harmony.luni.internal.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:186)
>         at java.net.URL.openStream(URL.java:671)
>         at HarmonyFileLocalhost.main(HarmonyFileLocalhost.java:11)
> ============== HarmonyFileLocalhost.java ===============
> import java.io.File;
> import java.io.InputStream;
> import java.net.URL;
> public class HarmonyFileLocalhost {
>     public static void main(String[] args) throws Exception {
>         String basedir = "./HarmonyFileLocalhost.java";
>         basedir = new File(basedir).getAbsolutePath();
>         String urlString = "file://localhost/" + basedir;
>         URL url = new URL(urlString);
>         InputStream is = url.openStream();
>         int c;
>         while ((c = is.read()) != -1) System.out.write(c);
>     }
> }
> This is a stripped down test for a failure in Axis2's org.apache.axis2.jaxws.description.PartialWSDLTests
test case.
> thanks,
> dims

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