I am writing a JAVA code to traverse FTP Location using Apache Commons Net FTPClient and getting output in an Excel file. the code execute correctly for approx 5 min but then gives an IOException:
org.apache.commons.net.ftp.FTPConnectionClosedException: FTP response 421 received. Server closed connection.
I am using commons-net-3.0.1.jar. I have done some R&D and tried:
setDefaultTimeout(6000);
setConnectTimeout(3000);
setSoTimeout(3000);
enterLocalPassiveMode();
and sending NOOP, but still getting the same error.
All I am trying to do is traverse through a directory and if file is found than get file name and file update date in excel else if directory is found then get inside and do until file is found again.
Please help and ask if any other information is required. I am new to JAVA.
解决方案
Error 421 Serv