commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Johnson" <an...@symonds.net>
Subject Connection reset during active FTP using Commons Net
Date Wed, 20 Oct 2004 11:29:50 GMT
Hi,

I'm using the Commons FTP API to transfer a file to an FTP server. The FTP
server is located outside our corporate network and supports only active
FTP.

The connection to the FTP server went through, but it was throwing the
following exception when I tried to put a file or do a directory listing:

java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:168)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
        at java.io.FilterInputStream.read(FilterInputStream.java:66)
        at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
        at
org.apache.commons.net.io.FromNetASCIIInputStream.__read(FromNetASCIIInputStream.java:74)
        at
org.apache.commons.net.io.FromNetASCIIInputStream.read(FromNetASCIIInputStream.java:169)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
        at
org.apache.commons.net.telnet.TelnetInputStream.__read(TelnetInputStream.java:104)
        at
org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInputStream.java:520)
        at java.lang.Thread.run(Thread.java:536)

I traced through the code and found that the FTP connection is getting
reset after the client sends the PORT command. After sending the PORT
command, the API tries to get the server's response in the method
__getReply() in FTP.java. The above exception was thrown in the following
line inside __getReply():

String line = _controlInput.readLine();

I'm attaching the test program that I used and the log. The same code
works fine when I ran it from a Windows desktop. The Linux version is SuSE
Linux Enterprise Server 8.0. Could this be because of some firewall
blocking the inbound connection from the FTP server? If so how can I
verify it?

Any pointers on why this happens will be of great help.

Thanks,
Anoop
Mime
View raw message