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

戏子无情 提交于 2019-11-27 10:16:00

We tested the Windows hotfix http://support.microsoft.com/kb/2754804 and confirmed that it did resolve the problem.

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.

I've submitted a bug report to Oracle, see bugs.sun.com/bugdatabase/view_bug.do?bug_id=7077696

They've marked the priority as low, which makes me think that they don't quite understand the magnitude of the problem, i.e. that FTP is broken on Java/Windows. I forgot to state that explicitly in the bug report. If anyone else feels like it should have a higher priority please add a comment to the Oracle bug report.

I just noticed that you can also 'vote' for the bug, so please give it a vote if you agree it's significant.

Another workaround is to start the JVM with:

-Djava.net.preferIPv4Stack=true

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.

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.

Actually TFTP under JDK7 on windows 7 also have the same problem, the MS hotfix does resolve FTP issue, but still not works for TFTP. Seems Oracle should report the same problem to MS and get another hotfix to resolve TFTP issue as well.

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

Davis Gereda Hernandez

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!