Java 7 prevents FTP transfers on Windows Vista and 7 if firewall is on. Any ideas?

后端 未结 9 1026
长情又很酷
长情又很酷 2020-12-02 05:43

Java 7 prevents FTP transfers on Windows Vista and 7.

In FTP, before a file is transferred a PORT or a PASV command must be sent. As soon as one of the commands is

相关标签:
9条回答
  • 2020-12-02 05:45

    I had the same problem using IDE Eclipse Neon, JAVA 7 and Windows 7 Professional. Trying to upload a PDF file to an FTP server. I solved it by running the following command in CMD as administrator:

    C: \ Users \ pc01> netsh advfirewall set global StatefulFTP disable
    
    0 讨论(0)
  • 2020-12-02 05:49

    Blogged about the issue here: http://podzemski.com/2011/09/12/java-7-prevents-ftp-transfers-on-windows-when-firewall-is-on/

    Maybe it'll cause some additional awareness of the problem.

    0 讨论(0)
  • 2020-12-02 05:49

    The same bug was reported here with a test case: Java 7 Socket Exception Bug forum. Its an issue with Java 7

    0 讨论(0)
  • 2020-12-02 05:55

    The problem is caused by the stateful FTP filter of the firewall. As a workaround you can disable it by executing netsh advfirewall set global StatefulFTP disable with administrator rights.

    0 讨论(0)
  • 2020-12-02 05:55

    Another workaround is to start the JVM with:

    -Djava.net.preferIPv4Stack=true
    
    0 讨论(0)
  • 2020-12-02 05:56

    This problem can be demonstrated without JDK7, it's the firewall in Windows 7 blocking the ftp protocol when the application is using IPv6-mapped IPv4 addresses. See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7077696 for more details and workarounds.

    0 讨论(0)
提交回复
热议问题