Apache Commons FTPClient问题-425无法建立数据连接:连接被拒绝 [英] Apache Commons FTPClient issue - 425 Can't build data connection: Connection refused

查看:99
本文介绍了Apache Commons FTPClient问题-425无法建立数据连接:连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆