Apache Commons FTPClient问题-425无法建立数据连接:连接被拒绝 [英] Apache Commons FTPClient issue - 425 Can't build data connection: Connection refused
问题描述
我正在尝试使用Apache Commons FTP库连接远程ftp服务器,我能够登录到FTP服务器,但是此后,我无法发出任何命令并在尝试检索文件时出现以下错误.
I am trying to connect a remote ftp server using Apache Commons FTP library, i am able to log into FTP server but after that i am not able to issue any command and getting following error when trying to retrieve file.
425无法建立数据连接:连接被拒绝.但是使用MS-DOS命令提示符登录时我没有遇到任何问题.
425 Can't build data connection: Connection refused. but I am facing no issue while login using MS-DOS command prompt.
有人知道会是什么问题吗?
Do anybody know what would be the issue ?
谢谢.
推荐答案
在看不到代码的情况下,这是黑暗中的一击,但您尝试过以下方法吗?
Without seeing code this is a stab in the dark, but have you tried the following
client.enterLocalPassiveMode();
(如果要从本地计算机上载到远程FTP服务器).我记得我有一个类似的问题,并且上述工作奏效了
if you are uploading from a local machine to a remote FTP server. I remember I had a similar problem and doing the above worked
这篇关于Apache Commons FTPClient问题-425无法建立数据连接:连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!