FTP取得文件一览报错
使用org.apache.commons包,取得文件一览报如下错误,应该怎么解决
org.apache.commons.net.ftp.
FTPConnectionClosedException: FTP response 421 received. Server closed connection.
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:346)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:490)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:534)
at org.apache.commons.net.ftp.FTP.cwd(FTP.java:758)
at org.apache.commons.net.ftp.FTPClient.changeWorkingDirectory(FTPClient.java:716)
at com.ftp.FileList.getFileList(FileList.java:70)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.getFileList(FileList.java:72)
at com.ftp.FileList.run(FileList.java:88)
at com.ftp.FileList.main(FileList.java:98)
java?FTP?commons
------解决方案--------------------Server closed connection
服务已经关闭了,所以链接就失败了
------解决方案--------------------是同一个ftp连接么,如果不是看看服ftp务器端有没有限制链接数,