java.net.SocketException: Connection reset
I'm getting the following error when attempting to run an applet on a server in a browser:
Quote:
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.ftp.impl.FtpClient.readServerResponse(Unkn own Source)
at sun.net.ftp.impl.FtpClient.readReply(Unknown Source)
at sun.net.ftp.impl.FtpClient.issueCommand(Unknown Source)
at sun.net.ftp.impl.FtpClient.issueCommandCheck(Unkno wn Source)
at sun.net.ftp.impl.FtpClient.openPassiveDataConnecti on(Unknown Source)
at sun.net.ftp.impl.FtpClient.openDataConnection(Unkn own Source)
at sun.net.ftp.impl.FtpClient.getFileStream(Unknown Source)
at sun.net.
http://www.protocol.ftp.FtpURLConnec...Stream(Unknown Source)
at airline.Connection.HttpCommunication.testMethod(Ht tpCommunication.java:62)
at airline.Connection.HttpCommunication.readCompanyNa meList(HttpCommunication.java:93)
at airline.UserApplet.AirlineGameApplet$1.run(Airline GameApplet.java:116)
at java.lang.Thread.run(Unknown Source)
The applet is signed. The code in question where the exception is being thrown is:
This exception does NOT get thrown while running the applet from the applet viewer in Eclipse. Anyone know of any reasons this would be happening? Any help is greatly appreciated.
Re: java.net.SocketException: Connection reset
This issue has been resolved, but I feel I should say something for everyone else who may have this issue:
There is currently a bug in Java 7 where it doesn't always play nice with the Windows firewall. (Bug ticket: http://bugs.sun.com/bugdatabase/view...bug_id=7077696)
To resolve this issue, the client needs to run their Command Prompt in Administrator mode, and type the command:
Quote:
netsh advfirewall set global StatefulFTP disable
This should prevent the instance of java.net.Socket from prematurely closing its connection.