[Original] How to Solve java.net. socketexception exceptions

Source: Internet
Author: User
Tags connection reset

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.