Apache Commons Net FTPClient retrievefile method issue with Sterling Commerce Connect
- by ravi2082
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