Details
Description
FTP URL's do not work when you specify a proxy to perform hostname lookup. You get a java.net.UnknownHostException error. It seems like the code that suppose to lookup the hostname using the proxy is broken. This happens on "JDK-1.2beta3-B". It also fails on "JDK1.1.5K". I don't see this problem with HTTP and GOPHER URL's. Here is the test code:
% java -DproxyHost=webcache.east.sun.com -DproxyPort=8080 GetURL -v -d -f data/GetURL.data -o results/GetURL
DEBUG: opening URL file: data/GetURL.data
DEBUG: parsing URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
DEBUG: java.net.UnknownHostException: ftp.javasoft.com, sleep 500ms and retry
DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
DEBUG: java.net.UnknownHostException: ftp.javasoft.com, sleep 500ms and retry
DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
DEBUG: java.net.UnknownHostException: ftp.javasoft.com, sleep 500ms and retry
DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
ERROR: GetURL.main(): exception occurred:
java.net.UnknownHostException: ftp.javasoft.com
java.net.UnknownHostException: ftp.javasoft.com
at java.net.InetAddress.getAllByName0(InetAddress.java:524)
at java.net.InetAddress.getAllByName0(InetAddress.java:469)
at java.net.InetAddress.getByName(InetAddress.java:388)
at java.net.Socket.<init>(Socket.java:91)
at sun.net.NetworkClient.doConnect(NetworkClient.java:56)
at sun.net.NetworkClient.openServer(NetworkClient.java:44)
at sun.net.ftp.FtpClient.openServer(FtpClient.java:248)
at sun.net.ftp.FtpClient.<init>(FtpClient.java:362)
at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:64)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:88)
at java.net.URL.openStream(URL.java:638)
at GetURL.main(GetURL.java:79)
FINALSTATUS:GetURL:EXIT_ERROR:2:Number of ERRORS:1:TEST INCOMPLETE
You can get the GetURL test from the (java.net) Test Suite located at:
http://jse.east/javanet/testpage.html
% java -DproxyHost=webcache.east.sun.com -DproxyPort=8080 GetURL -v -d -f data/GetURL.data -o results/GetURL
DEBUG: opening URL file: data/GetURL.data
DEBUG: parsing URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
DEBUG: java.net.UnknownHostException: ftp.javasoft.com, sleep 500ms and retry
DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
DEBUG: java.net.UnknownHostException: ftp.javasoft.com, sleep 500ms and retry
DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
DEBUG: java.net.UnknownHostException: ftp.javasoft.com, sleep 500ms and retry
DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
ERROR: GetURL.main(): exception occurred:
java.net.UnknownHostException: ftp.javasoft.com
java.net.UnknownHostException: ftp.javasoft.com
at java.net.InetAddress.getAllByName0(InetAddress.java:524)
at java.net.InetAddress.getAllByName0(InetAddress.java:469)
at java.net.InetAddress.getByName(InetAddress.java:388)
at java.net.Socket.<init>(Socket.java:91)
at sun.net.NetworkClient.doConnect(NetworkClient.java:56)
at sun.net.NetworkClient.openServer(NetworkClient.java:44)
at sun.net.ftp.FtpClient.openServer(FtpClient.java:248)
at sun.net.ftp.FtpClient.<init>(FtpClient.java:362)
at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:64)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:88)
at java.net.URL.openStream(URL.java:638)
at GetURL.main(GetURL.java:79)
FINALSTATUS:GetURL:EXIT_ERROR:2:Number of ERRORS:1:TEST INCOMPLETE
You can get the GetURL test from the (java.net) Test Suite located at:
http://jse.east/javanet/testpage.html
Attachments
Issue Links
- relates to
-
JDK-4151208 FTP URL's don't work using a proxy host in JDK1.1.7B.
-
- Closed
-