I'm getting an exception in my Java, Hibernate, MySQL project within Netbeans IDE.
I've done some digging to try and fix this strange Socket exception, to no avail.
Some forum solutions suggested implementing a c3p0 connection pool for Hibernate. No fix.
Others suggested disabling AV and firewall (!!) as these could interfere with the socket connection. No fix.
I've tagged this question with Hibernate, as I'm not certain that hibernate is the cause, but the exceptions occur on a Hibernate call (running a query). Other Hibernate code in the app works fine. The Hibernate version is 3.2 .
The exception:
NotifyUtil::java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2676)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUtil.java:299)
This exception may occur once, or a few times, and be followed by none or a few of this exception:
NotifyUtil::java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2676)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUtil.java:299)
Help would be much appreciated. This is a bit of a strange one.
Thanks.
java.net.SocketException: Connection reset This SocketException occurs on the server-side when the client closed the socket connection before the response could be returned over the socket. For example, by quitting the browser before the response was retrieved. Connection reset simply means that a TCP RST was received.
Possible solution: Check Virus scan service whether it's blocking the port for the outgoing requests for connections. Software caused connection abort: socket write error. Possible solution: Make sure you're writing the correct length of bytes to the stream. So double check what you're sending.
In my case, I was using Tomcat. Right click on Tomcat in Server list and then click properties, then uncheck "Enable HTTP Monitor". This solve my issues
There's a Microsoft Knowledge Base article about this, see if you can find it. Basically this is a result of prior errors writing to the network by the peer that gets the exception. Indicates a network problem rather than software.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With