[ 
https://issues.apache.org/jira/browse/NET-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910622#action_12910622
 ] 

Anil Gaddipati commented on NET-61:
-----------------------------------

Llooks like this is an issue between FtpClient(on Linux servers) and FTPServer
 
FtpClient from Linux hangs after certain point of time. Because of unusual 
nature of communication between ftp Client(in this case its Linux) and Server 
certain port numbers should be open on Client (Linux server) for ftp Server to 
send back data. But due to firewall restrictions most of these unprivileged 
ports are closed on Linux. 
Apparently it looks like ftp Server uses a different port each time a request 
comes from ftp Client, some of which are not open on Linux. 
 
The solution is Ftp Client to enter "passive" (PASV) mode. In passive mode Ftp 
Client (on Linux) opens a dedicated port for server to send back data.
I have verified these changes on NewMedia Stage and its working

FtpClient.enterLocalPassiveMode()

You can read more http://slacksite.com/other/ftp.html


> [net] FTPClient.listFiles() hangs on Red Hat Linux
> --------------------------------------------------
>
>                 Key: NET-61
>                 URL: https://issues.apache.org/jira/browse/NET-61
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 1.4
>         Environment: Operating System: Linux
> Platform: PC
>            Reporter: George Van Treeck
>            Priority: Blocker
>
> A Java app that uses FTPClient to download a file from a website to Windows 
> XP 
> works properly. But, when the same app runs on Linux to download the same 
> file 
> from the same website, it hangs at listFiles().
> Using Java 1.5.0_03 on both the Windows XP and Linux. The version of Linux 
> used is Fedor Red Hat Linux Core 3 with all the latest updates. The following 
> segment of code from the program demonstrates the problem:
>               FTPClient ftp = new FTPClient();
>               ftp.connect(host);
>               reply = ftp.getReplyCode();
>               if (!FTPReply.isPositiveCompletion(reply)) {
>                 final String ftpStatus = ftp.getReplyString();
>                 ftp.disconnect();
>                 throw new IOException(
>                     "FTP server refused connection. Status: " +
>                    ftpStatus);
>               }
>               ftp.login(user, password);
>               reply = ftp.getReplyCode();
>               if (!FTPReply.isPositiveCompletion(reply)) {
>                 final String ftpStatus = ftp.getReplyString();
>                 ftp.disconnect();
>                 throw new IOException(
>                     "FTP server refused username/password. Status: " +
>                    ftpStatus);
>               }
>               String[] list = ftp.listNames();

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

Reply via email to