wood burning stoves
The moose likes Servlets and the fly likes Connection reset by peer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Connection reset by peer" Watch "Connection reset by peer" New topic

Connection reset by peer

tanu gulati

Joined: May 11, 2002
Posts: 2
on the login page where user puts in user name and password, when i hit the submit button couple of times quickly without filling userid and password, i get java.net.SocketException. Connection reset by peer.
I am using Tomcat as web server. My hunch is that since Tomcat is not able to handle so many hits, thats why i am getting this error. But i am not sure as to why i am getting this error. If sb could tell me how many hits can tomcat take successfully. and can i configure Tomcat to take more hits ?? if yes where can i do that ?
thanks to all of you in advance
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
Connection reset by peer from Java means that the browser closed the connection. This is not a reflection of the number of simultaneous requests that Tomcat can handle.
Gabriel Fox
Ranch Hand

Joined: Oct 17, 2001
Posts: 170
Hi William ,
1.Can U shed some light on browser connection
2.what can make the browser close the connection
3.How can this error be avoided
All ideas are welcomed.
[ May 12, 2002: Message edited by: Gabriel Fox ]
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Here is a related post about non-fatal "connection reset by peer" errors in Tomcat 3.x

Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
This is the problem we faced. This happened when we are using MVC architecure for our portal.
What happened is when submitted twice requests are sent to same controller and controller is not thread safe.. So shared objects like session objects, Application objects are corrupted and when these corrupoted objects (Usually value beans stored in session/Application)are used in JSP code this exception is thrown..
We resolved this problem by disabling submit button after submission..
One more solution is making servlet and other related components thread safe by implementing SingleThreadModel but this may pose a serious performance problems.
Hope this helps..
Gabriel Fox
Ranch Hand

Joined: Oct 17, 2001
Posts: 170
Cheers guys for the solid info.
Nice reference on connection-reset by peer
i have confirmed it's true nature from the Tomcat
conf directory.
tanu gulati

Joined: May 11, 2002
Posts: 2
thanks everybody for ideas and thoughts
I agree. Here's the link: http://aspose.com/file-tools
subject: Connection reset by peer
It's not a secret anymore!