ftp dir returns java error

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 comentario

Walter Roberson
Walter Roberson el 8 de Ag. de 2016
Are you using a proxy? ftp does not support proxy.

Iniciar sesión para comentar.

Respuestas (1)

Soumya Saxena
Soumya Saxena el 12 de Ag. de 2016

0 votos

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.

Categorías

Etiquetas

Preguntada:

el 8 de Ag. de 2016

Respondida:

el 12 de Ag. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by