ftp dir returns java error

6 ビュー (過去 30 日間)
Matthew
Matthew 2016 年 8 月 8 日
回答済み: Soumya Saxena 2016 年 8 月 12 日
I get the following error on an ftp object. help?
>> dir( fo)
Error using ftp/dir (line 64)
Java exception occurred:
java.net.SocketException: Operation timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:154)
at java.io.BufferedReader.readLine(BufferedReader.java:317)
at java.io.BufferedReader.readLine(BufferedReader.java:382)
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:294)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:490)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:534)
at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:476)
at org.apache.commons.net.ftp.FTPClient.listNames(FTPClient.java:1950)
>> fo
fo =
FTP Object
host: ftp.box.com
user: mdzieciuch@ucsd.edu
dir: /philsea10_data
mode: binary
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 8 月 8 日
Are you using a proxy? ftp does not support proxy.

サインインしてコメントする。

回答 (1 件)

Soumya Saxena
Soumya Saxena 2016 年 8 月 12 日
I understand that you are getting a java exception when using the “dir” command on a ftp object.
This may be caused by a firewall which is blocking an "active" ftp connection. Many firewalls are configured to allow only “passive” FTP connections.
In my opinion you can debug this issue by using an external debugger like WireShark. This will allow you to intercept the commands being sent by MATLAB to the FTP server and compare them to the commands being sent by another FTP client to the server that is working fine. In this way, you may check possible incompatibilities.

カテゴリ

Help Center および File ExchangeCall Web Services from MATLAB Using HTTP についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by