I saw this post on the forum today. I feel that this question is worth summing up.
I hope to help myself and everyone
When I insert news, the following error occurs on the server:
** Begin nested exception **
Java.net. socketexception
Message: Connection reset by peer: Socket write error
Stacktrace:
Java.net. socketexception: Connection reset by peer: Socket write error
At java.net. socketoutputstream. socketwrite0 (native method)
At java.net. socketoutputstream. socketwrite (socketoutputstream. Java: 92)
At java.net. socketoutputstream. Write (socketoutputstream. Java: 136)
At java. Io. bufferedoutputstream. flushbuffer (bufferedoutputstream. Java: 65)
At java. Io. bufferedoutputstream. Flush (bufferedoutputstream. Java: 123)
At com. MySQL. JDBC. mysqlio. Send (mysqlio. Java: 2739)
At com. MySQL. JDBC. mysqlio. Send (mysqlio. Java: 2650)
At com. MySQL. JDBC. mysqlio. sendcommand (mysqlio. Java: 1581)
At com. MySQL. JDBC. mysqlio. sqlquerydirect (mysqlio. Java: 1695)
At com.mysql.jdbc.connection.exe csql (connection. Java: 3026)
At com.mysql.jdbc.preparedstatement.exe cuteinternal (preparedstatement. Java: 1137)
At com.mysql.jdbc.preparedstatement.exe cuteupdate (preparedstatement. Java: 1368)
.......
How can this problem be solved? Could you please help me .....
My answer:
Connection reset by peer: Socket write error
This has nothing to do with the database. When the client sends a request, if the response from the server is not fully obtained ),
If the client is disconnected from the server segment (for example, the network is disconnected, the "stop" button is pressed, or the client browser is closed), the server throws this exception.
Reference the reply from yuanhong1985 on the third floor:
If you restart tomcat, this problem will not occur, but it will not be long before. How can this problem be solved?
You said your above situation
Check:
In the conf/server. xml file under the tomcat installation directory
<Connector
Port = "8080"
Maxthreads = "150" minsparethreads = "25" maxsparethreads = "75"
Enablelookups = "false" redirectport = "8443" acceptcount = "100"
DEBUG = "0" connectiontimeout = "20000"
Disableuploadtimeout = "true"/>
Check whether the database connection times out.
Yes, that's the problem. Thank you)