5

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.

0

3 Answers 3

6

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

Sign up to request clarification or add additional context in comments.

4 Comments

yep this helps, but you can't use the HTTP Monitor anymore
you can always enable it when you need it. Do not enable HTTP Monitor can also make your application run faster.
For newbies ... To disable HTTP monitor for a specific server: Tools --> Server --> Choose the server --> Toggle Enable HTTP Monitor
Very very unlikely. This is caused by network problems, not by software configurations. I suspect this solved a different problem, probably 'connection reset by peer'.
2

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.

6 Comments

Thanks for replying, I appreciate your help. I've done some looking through the Microsoft KB site. I've only found a couple articles. I should add I'm running Windows 7 x64. None of the articles are relevant, as far as I can see. Do you mean one of these: support.microsoft.com/kb/204594 support.microsoft.com/kb/819124 support.microsoft.com/kb/331756 support.microsoft.com/kb/830597.
@mieze it corresponds to 'WSAECONNABORTED (10053) Translation: Software caused connection abort. Description: An established connection was stopped by the software in your host computer, possibly because of a data transmission time-out or protocol error.'
Ah I see. Do you have any idea on how to go about troubleshooting this? I'm stumped.
@mieze you're going to have to sniff the network, looking for TCP retransmissions from the node that gets this exception, then work upstream until you find the offending segment or node or bridge or router.
Turns out the answer is, at least for me, to roll back. From Netbeans 7 > 6.9, from JDK 6 to 5, from Tomcat 7 to 6. I know this leaves a VERY WIDE area in which this issue could have originated, but it did resolve the problem. I might add, this issue did not seem to affect the operation of my app (I thought it was the cause of a problem that turned out to be something else). I rolled back for a different reason and it went away. I suspect buggy Netbeans 7, but this is only a suspicion as the 7.0 release is reputed to be buggy.
|
-1

It is a network error!

1.If you run your sparkstreaming on windows.just run:

ncat.exe -lk 7777

and download ncat.exe at https://nmap.org/ncat/

2.If you run your sparkstreaming on linux.just run:

nc -lk 7777

and make sure you have install on your linux

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.