已收到FTP响应421。服务器关闭连接 [英] FTP response 421 received. Server closed connection

查看:8116
本文介绍了已收到FTP响应421。服务器关闭连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个JAVA代码来使用Apache Commons Net FTPClient遍历FTP位置并获取Excel文件中的输出。代码正确执行大约5分钟,但随后发生IOException:

  org.apache.commons.net.ftp.FTPConnectionClosedException:已收到FTP响应421。服务器关闭连接。 

我正在使用commons-net-3.0.1.jar。我已经做了一些研发,并试过:

  setDefaultTimeout(6000); 
setConnectTimeout(3000);
setSoTimeout(3000);
enterLocalPassiveMode();

并发送 NOOP ,但仍然收到同样的错误。

所有我想要做的是遍历一个目录,如果发现文件比在excel中获取文件名和文件更新日期如果找到目录,那么进入里面,直到文件再次被发现。



请帮助并询问是否需要其他信息。我是JAVA新手。 rel =nofollow noreferrer> http://kb.globalscape.com/KnowledgebaseArticle10142.aspx

 
错误421服务不可用,关闭控制连接。
错误421达到用户限制
错误421您无权建立连接
错误421达到最大连接数
错误421超过最大连接数

也许你没有重用连接,而是为每个请求使用新的连接,用连接淹没服务器,直到达到连接限制。
尝试关闭您的连接或重新连接。


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.

解决方案

See here: http://kb.globalscape.com/KnowledgebaseArticle10142.aspx

    Error 421 Service not available, closing control connection. 
    Error 421 User limit reached 
    Error 421 You are not authorized to make the connection 
    Error 421 Max connections reached 
    Error 421 Max connections exceeded 

Maybe you're not reusing a connection but using a new connection for every request, flooding the server with connections until it hits the connection limit. Try closing your connections or resuing them.

这篇关于已收到FTP响应421。服务器关闭连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆