现象:

在springboot的定时器轮询去下载ftp文件时,报以下错误:

org.apache.commons.net.ftp.FTPConnectionClosedException: FTP response 421 received. Server closed connection.
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:367)
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:294)
at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:400)
at org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:924)

原因分析:

1.Connection closed without indication.//FTP服务器服务有故障,或是是网络问题。
2. FTP response 421 received. Server closed connection.//错误原因就是FTP服务器端连接数满了

故得知是因为原因2造成ftp的连接数满了,又查看vsftp.log得到:too many sessions for this address

证实了就是连接数满造成。

解决方案:

将FTPClient.connect();
改成:
if(!FTPClient.isConnected()){
FTPClient.connect();
}

故此解决。希望能帮到大家。

FTP response 421 received. Server closed connection的更多相关文章

  1. nginx error: upstream prematurely closed connection while reading response header from upstream

    本篇文章由:http://xinpure.com/nginx-error-upstream-prematurely-closed-connection-while-reading-response-h ...

  2. FTPClient TLS 与 FTP 进行数据传输异常:Remote host closed connection during handshake

    环境:java JDK 1.8.org.apache.commons-net-3.6.jar.端口已放开 FTPClient ftpClient = new FTPClient(protocol, f ...

  3. 解决flask的502错误:upstream prematurely closed connection while reading response header from upstream

    我在使用 tiangolo/uwsgi-nginx-flask 部署flask应用的时候,经常运行一会儿就出现502错误,重新启动容器后,就恢复. 且经常会出现数据更新后,刷新结果不一致. docke ...

  4. The message port closed before a response was received.

    问题描述:Chrome控制台报错:Unchecked runtime.lastError: The message port closed before a response was received ...

  5. Chrome 控制台报错Unchecked runtime.lastError: The message port closed before a response was received

    Chrome浏览器控制台报错提示 Unchecked runtime.lastError: The message port closed before a response was received ...

  6. upstream prematurely closed connection while reading response header from upstream

    upstream prematurely closed connection while reading response header from upstream nginx配置uwsgi的时候  ...

  7. Nginx" upstream prematurely closed connection while reading response header from upstream"问题排查

    问题背景 我们这边是一个基于Nginx的API网关(以下标记为A),最近两天有调用方反馈,偶尔会出现502错误,我们从Nginx的error日志里看,就会发现有" upstream prem ...

  8. RemoteDisconnected: Remote end closed connection without response

  9. SharePoint Error - An unrecognized HTTP response was received when attempting to crawl this item

    SharePoint 2013爬网报错 An unrecognized HTTP response was received when attempting to crawl this item. V ...

随机推荐

  1. MyEclipse在不同编辑面间快速切换

    想在下面的编辑页面间切换有两种方式,一种是按“栈”方式切换,一种是按“链表”方式切换. 按栈方式切换: Alt + 左箭头: 上一次编辑页面 Alter + 右箭头 : 下一个编辑也页面 按链表(绝对 ...

  2. NSDictionary 和NSArray 排序(sort)

    排序: NSMutableDictionary *dic=[[NSMutableDictionary alloc]init]; [dic setValue:@"第3个" forKe ...

  3. 啰里吧嗦kafka

    1.kafka是什么 kafka官网: http://kafka.apache.org/ kafka是一种高吞吐量的分布式发布订阅消息系统,用它可以在不同系统中间传递分发消息 2.zookeeper是 ...

  4. mysql中的坑

    1,MySQL建表中double类型不能限制数据长度! 2,……

  5. styled-components 弃用 injectGlobal

    styled-components 最新版本是v4.1.2,但是从v4开始,就酱原来的injectGlobal方法用createGlobalStyle替换了.用法上也有一些不同了: 我今天直接引inj ...

  6. php5.5过渡--mysql连接

    以前: // $conn=mysql_connect("localhost","root","");// $db=mysql_select_ ...

  7. JavaScript之Array

    JavaScript是一门非常灵活的动态语言,涵盖的内容也挺多,<JavaScript高级程序设计>看了也有两遍,但是在实际开发的时候,还是有很多东西记不清,然后还得去翻书,特别是一些Ar ...

  8. HTML学习笔记《一》 ---- HTML基本认识

    HTML 基本认识 一.简介 1.HTML是超文本标记语言,标准通用标记语言下的一个应用,解释性语言. 2.“超文本”就是指页面内可以包含图片.链接,甚至音乐.程序等非文字元素. 3.超文本标记语言的 ...

  9. <Android 基础(二十五)> Frame Animation

    简介 Frame Animation, 逐帧动画,通过定义一系列的Drawable对象来实现动画效果,可以用来作为视图的背景. Frame Animation在代码中体现为AnimationDrawa ...

  10. unrecognized selector sent to class

    Other Linker Flags=-ObjC -all_load Loads all members of static archive libraries. -ObjC Loads all me ...