FTP上传文件 SocketException: Connection reset
来源:互联网 发布:淘宝店铺入口图 编辑:程序博客网 时间:2024/05/01 20:40
FTP上传文件报的异常,我基本代码如下:
FTPClient client = new FTPClient();InputStream in = new ByteArrayInputStream("IT WORKS! :D".getBytes());try { client.connect("localhost"); client.login("user", "password"); client.enterLocalPassiveMode(); client.storeFile("textfile.txt", in);} finally { try { in.close(); client.logout(); client.disconnect(); } catch (Exception e) { }}
在storeFile 方法会报异常throws a java.net.SocketException:
这是一个java 7 在windows上的bug
解决办法:
用administrator用户登陆使用命令行执行:
netsh advfirewall set global StatefulFTP disable
即可。 1 0
- FTP上传文件 SocketException: Connection reset
- java.net.SocketException: Connection reset
- java.net.SocketException: Connection reset
- java.net.SocketException: Connection reset
- java.net.SocketException: Connection reset
- java.net.SocketException: Connection reset .
- java.net.SocketException: Connection reset
- SocketException: Connection Reset by peer
- java.net.SocketException: Connection reset
- Java.net.SocketException:Connection reset
- java.net.SocketException: Connection reset
- java.net.SocketException: Connection reset
- weblogic中 java.net.SocketException: Connection reset
- 《转》java.net.SocketException Connection reset
- java.net.SocketException: Connection reset问题
- java.net.SocketException: Connection reset产生原因
- java.net.SocketException: Connection reset 解决方法
- Android HessianConnectionException SocketException (Connection reset by
- 常州测试day2:flower
- Python学习之路,每日一记
- ASCII码对照表
- 基于@Aspect的AOP配置
- 各类链接(外部链接、内部链接……)的使用方法合集
- FTP上传文件 SocketException: Connection reset
- [LeetCode]--327. Count of Range Sum && Merge_Sort && Fenwick Tree
- python学习笔记(1)之如何在python3.x下安装PIL、numpy以及matplotlib
- oracle连接总结(内连接、外连接、自然连接,交叉连接,自连接)
- PHP安全编程之暴力破解攻击
- spring aop出现0 can't find referenced pointcut mymethod
- POJ 1218 The Drunk Jailer
- JBPM4基础篇05-设计请假流程,流程的发起,执行,驳回,监控web Demo
- JBPM4基础篇06-IdentityService实现组织机构