• <i id='le0gY'><tr id='le0gY'><dt id='le0gY'><q id='le0gY'><span id='le0gY'><b id='le0gY'><form id='le0gY'><ins id='le0gY'></ins><ul id='le0gY'></ul><sub id='le0gY'></sub></form><legend id='le0gY'></legend><bdo id='le0gY'><pre id='le0gY'><center id='le0gY'></center></pre></bdo></b><th id='le0gY'></th></span></q></dt></tr></i><div id='le0gY'><tfoot id='le0gY'></tfoot><dl id='le0gY'><fieldset id='le0gY'></fieldset></dl></div>

        <legend id='le0gY'><style id='le0gY'><dir id='le0gY'><q id='le0gY'></q></dir></style></legend>
      1. <tfoot id='le0gY'></tfoot>

          <bdo id='le0gY'></bdo><ul id='le0gY'></ul>

        <small id='le0gY'></small><noframes id='le0gY'>

      2. FTPClient Uploading File = SocketException: Connection reset

        时间:2023-09-26
          <tfoot id='pPwAe'></tfoot>

              <bdo id='pPwAe'></bdo><ul id='pPwAe'></ul>
              <i id='pPwAe'><tr id='pPwAe'><dt id='pPwAe'><q id='pPwAe'><span id='pPwAe'><b id='pPwAe'><form id='pPwAe'><ins id='pPwAe'></ins><ul id='pPwAe'></ul><sub id='pPwAe'></sub></form><legend id='pPwAe'></legend><bdo id='pPwAe'><pre id='pPwAe'><center id='pPwAe'></center></pre></bdo></b><th id='pPwAe'></th></span></q></dt></tr></i><div id='pPwAe'><tfoot id='pPwAe'></tfoot><dl id='pPwAe'><fieldset id='pPwAe'></fieldset></dl></div>

                <legend id='pPwAe'><style id='pPwAe'><dir id='pPwAe'><q id='pPwAe'></q></dir></style></legend>

                  <tbody id='pPwAe'></tbody>

                  <small id='pPwAe'></small><noframes id='pPwAe'>

                • 本文介绍了FTPClient Uploading File = SocketException: Connection reset的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试使用 XAMPP 和 FileZilla 通过 FTP 上传一个简单的 txt 文件.
                  我正在使用 Apache Commons Net 3.0.1 库.
                  这是我的代码,非常基本的东西:

                  I'm trying to upload a simple txt file via FTP using XAMPP and FileZilla.
                  I'm using the Apache Commons Net 3.0.1 Library.
                  This is my code, very basic things:

                  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() 抛出 java.net.SocketException:


                  But... storeFile() throws a java.net.SocketException:

                  Exception in thread "main" java.net.SocketException: Connection reset
                      at java.net.SocketInputStream.read(SocketInputStream.java:189)
                      at java.net.SocketInputStream.read(SocketInputStream.java:121)
                      at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
                      at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
                      at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
                      at java.io.InputStreamReader.read(InputStreamReader.java:184)
                      at java.io.BufferedReader.fill(BufferedReader.java:154)
                      at java.io.BufferedReader.read(BufferedReader.java:175)
                      at org.apache.commons.net.io.CRLFLineReader.readLine(CRLFLineReader.java:58)
                      at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:310)
                      at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:290)
                      at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:474)
                      at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:547)
                      at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:596)
                      at org.apache.commons.net.ftp.FTP.pasv(FTP.java:945)
                      at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:719)
                      at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:551)
                      at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1704)
                      at ftpexample.ftpexample.main(ftpprova.java:17)
                  


                  有什么问题??:(我还尝试了在线托管服务,结果相同...
                  请问这是防火墙还是windows服务相关的问题??


                  What's the problem?? :( I tried also on an online hosting service, with the same result...
                  I wonder if this is a firewall or windows' services related problem??

                  推荐答案

                  通过在命令提示符下以管理员身份运行解决:

                  netsh advfirewall set global StatefulFTP disable
                  

                  这是 Windows 机器上的 Java 7 错误,报告 这里.

                  This is a Java 7 bug on Windows machines, it is reported here.

                  这篇关于FTPClient Uploading File = SocketException: Connection reset的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:xampp 1.7.4 + winxp + 日食 下一篇:如何使用 JDBC 连接 XAMPP MySQL 本地数据库?

                  相关文章

                  最新文章

                    <i id='BaPkP'><tr id='BaPkP'><dt id='BaPkP'><q id='BaPkP'><span id='BaPkP'><b id='BaPkP'><form id='BaPkP'><ins id='BaPkP'></ins><ul id='BaPkP'></ul><sub id='BaPkP'></sub></form><legend id='BaPkP'></legend><bdo id='BaPkP'><pre id='BaPkP'><center id='BaPkP'></center></pre></bdo></b><th id='BaPkP'></th></span></q></dt></tr></i><div id='BaPkP'><tfoot id='BaPkP'></tfoot><dl id='BaPkP'><fieldset id='BaPkP'></fieldset></dl></div>
                    <tfoot id='BaPkP'></tfoot>
                      <legend id='BaPkP'><style id='BaPkP'><dir id='BaPkP'><q id='BaPkP'></q></dir></style></legend>
                    1. <small id='BaPkP'></small><noframes id='BaPkP'>

                        <bdo id='BaPkP'></bdo><ul id='BaPkP'></ul>