FTP not working on Java 7 on Windows 7 and VISTA when Windows Firewall is enabled

来源:互联网 发布:农业财政支出数据 编辑:程序博客网 时间:2024/06/05 19:18

Problem:

In FTP, before a file is transferred a PASV command must be sent. As soon the command is sent, the Windows Firewall closes the socket that sent it. This only happens if the firewall is turned on and Java 7 is used.

In FileCatalyst/Unlimi-Tech products an error message appears saying: "Could not load remote directory listing"

Products affected:

All FileCatalyst/Unlimi-Tech products

Solution 1:

You must disable Stateful FTP rules on the Windows Firewall. Open Command Line Prompt and type this line (without the quotes):

"netsh advfirewall set global StatefulFTP disable"

The problem is with Windows Firewall, Microsoft has been informed.

Solution 2:

You must disable IPv6 on your server and use only IPv4 stack, this will force all Windows clients to connect with the IPv4 stack and the problem will not appear.

Solution 3:

At runtime in the java startup command, add the following switch: -Djava.net.preferIPv4Stack=true

Solution 4:

Enable SSL Security (FTPS), Stateful Firewall inspection must be able to read the traffic which is not possible when FTPS is used.

External Links:

http://stackoverflow.com/questions/6990663/java-7-prevents-ftp-transfers-on-windows-vista-and-7-if-firewall-is-on-any-idea

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7077696