现象:

在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. 为什么有int 和integer

    1.Integer 是对象类型 int是原始类型 适用场合有很大的不同 之所以要把int封装成Integer 型 是因为 很多方法参数就只接收对象类型(Object) 还比如 范型 就只支持 对象类型 ...

  2. mssql名词解释

    因为自己在sql这部分不强,有时候碰到一些名词我都不知道什么意思,所以在这里记录下,方便以后查看 1.NOT FOR REPLICATION  控制约束.标志和触发器  在所有IDENTITY属性字段 ...

  3. [日常] Go语言圣经-GIF动画练习语法

    1.常量声明的值必须是一个数字值.字符串或者一个固定的boolean值.2.常量声明和变量声明一般都会出现在包级别3.[]color.Color{...}生成的是一个slice切片和gif.GIF{. ...

  4. 四:Jquery-animate

    动画效果: 1.显示/隐藏动画效果 动态的改变当前元素的宽,高和不透明度 show([duration],[fn]); //显示当前元素 hide([duration],[fn]); //隐藏当前元素 ...

  5. HDU 1695 GCD 欧拉函数+容斥定理 || 莫比乌斯反演

    GCD Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...

  6. js 中使用 #region #endregion

    vs 和 vs code 都是可以支持 js 使用 #region 折叠代码的:code 我就不说了 同理vs 的: 首先下载 vs 插件,插件路径:https://archive.codeplex. ...

  7. 进程间通信IPC -- 管道, 队列

    进程间通信--IPC(Inter-Process Communication) 管道 from multiprocessing import Pipecon1,con2 = Pipe()管道是不安全的 ...

  8. Spring是什么、spring容器、Spring三大核心思想DI(依赖注入)、IOC(控制反转)、AOP(面向切面编程)

    1.Spring (1)Spring是什么? 是一个轻量级的.用来简化企业级应用开发的开发框架. 注: a.简化开发: Spring对常用的api做了简化,比如,使用Spring jdbc来访问数据库 ...

  9. 转:PHP导出excel文件的几种方式

    PHP导出excel文件的几种方式 文章来源:http://www.cnblogs.com/fredshare/archive/2012/10/29/2744243.html 先说说动态生成的内容当作 ...

  10. 移动端h5实现拍照上传图片并预览&webuploader

    .移动端实现图片上传并预览,用到h5的input的file属性及filereader对象:经测除了android上不支持多图片上传,其他基本ok实用: 一:先说一下单张图片上传(先上代码): html ...