Apache Commons Net FTPClient retrievefile method issue with Sterling Commerce Connect

Posted by ravi2082 on Stack Overflow See other posts from Stack Overflow or by ravi2082
Published on 2010-02-18T12:04:35Z Indexed on 2010/03/23 16:43 UTC
Read the original article Hit count: 563

Filed under:
|
|
|

Hi All,

We have been using apache commons net FTP classes to connect using a proxy to a Sterling commerce FTP gateway located outside our network to pull files. We do not list the files since we know the name of the file to be pulled so we pull it directly using the below method.

boolean isTransferred = ftp.retrieveFile(remoteFileName, outputFile);

It was working since 3 years and we have been facing issues since last 2 weeks. The error occurs at above line and is

org.apache.commons.net.ftp.FTPConnectionClosedException: FTP response 421 received. Server closed connection. org.apache.commons.net.ftp.FTP.__getReply(FTP.java:347) org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:450) org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:478) org.apache.commons.net.ftp.FTPClient.openDataConnection(FTPClient.java:476) org.apache.commons.net.ftp.FTPClient.retrieveFile(FTPClient.java:1228)

We are facing these issues intermittently since last 2 weeks and not sure what could be the root cause of it. Nothing has changed on the either side. Any ideas what could be the issue?

Thanks, Ravi

© Stack Overflow or respective owner

Related posts about apache-commons

Related posts about ftp