Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SocketException: Software caused connection abort: recv failed

 
Adnan Saleem
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making a course project, FTP.

My project works fine in Linux, but same code doesn't works in Windows. error comes in FTP Client Side.

Here is the Output and Stack trace of project.

Trying to connect anonymously to localhost
220 localhost FTP server ready for Client 0.
331 Password required for anonymous.
Successfully logged in!
230 User anonymous logged in.
System type is: UNIX - I mean Java.
215 UNIX - I mean Java.
Current directory is: /
257 /
java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
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 ftpclient.FTPConnection.getFullServerReply(FTPConnection.java:425)
at ftpclient.FTPConnection.getServerReply(FTPConnection.java:410)
at ftpclient.FTPConnection.openPort(FTPConnection.java:882)
at ftpclient.FTPConnection.setupDataPort(FTPConnection.java:819)
at ftpclient.FTPConnection.executeDataCommand(FTPConnection.java:760)
at ftpclient.FTPConnection.processFileListCommand(FTPConnection.java:537)
at ftpclient.FTPConnection.getAndParseDirList(FTPConnection.java:571)
at ftpclient.FTPConnection.listFiles(FTPConnection.java:486)
at ftpclient.FTPConnection.listFiles(FTPConnection.java:471)
at ftpclient.TestFTP.main(TestFTP.java:42)

Any help will be appreciated. Thanks!
 
Adnan Saleem
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Error resolved. Just turn off your firewall! and that will do the work.
 
Rob Spoor
Sheriff
Pie
Posts: 20667
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't turn off your firewall. Instead, add a rule that allows FTP connections. This way you'll still block access you don't want. In other words - don't allow all, only allow what you want.
 
Adnan Saleem
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks thats a much better option! I'll do that!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic