I have some Java code which looks roughly like this:
String urlString = "ftp://polar.ncep.noaa.gov/pub/history/waves/multi_1.glo_30m.dp.200601.grb2";
URL url = new URL(urlString);
URLConnection conn = url.openConnection();
InputStream is = conn.getInputStream();
When I get to the last line, the code hangs and never returns. When I attach Wireshark and look at the conversation, it ends like this:
...
EPSV ALL
200 EPSV ALL ok.
EPSV
229 Entering Extended Passive Mode (|||32647|)
EPRT |1|144.212.217.249|58416|
200 EPRT command successful. Consider using EPSV.
RETR multi_1.glo_30m.dp.200601.grb2
150 Opening BINARY mode data connection for multi_1.glo_30m.dp.200601.grb2 (55796622 bytes).
426 Failure writing network stream.
This URL works fine in my browser. Other sites work fine with this Java code. Any ideas why this combination is having trouble?
This is likely a bug in Sun’s implementation. I’ve reported it here:
https://bugs.java.com/bugdatabase/view_bug?bug_id=7148208