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 CenterFile Exchange에서 Call 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