Connection reset : java.net.SocketException

0 votes
Getting this error when trying to read from a socket. I'm doing a readInt() on that InputStream, and I am getting this error. Going through the documentation this suggests that the client part of the connection closed the connection. In this scenario, I am the server.

I have access to the client log files and it is not closing the connection, and also, its log files suggest I am closing the connection.

So does anybody have an idea why this is happening? What else to check for? Does this arise when there are local resources that are perhaps reaching thresholds?
May 30, 2018 in Java by Daisy
• 8,110 points
2,650 views

2 answers to this question.

0 votes

We had this problem with a SOA system written in Java. we were running both the client and the server on different machines and they worked fine for a long time, then those weird connection resets appeared in the client log and there was not anything strange in the server log. Restarting both client and server didn't solve the problem.

Finally, we discovered that the heap on the server side was rather full so we increased the memory available to the JVM: problem solved!

answered May 30, 2018 by Parth
• 4,630 points
0 votes

You should check whether the client program is finishing before server read the streams.

answered Sep 6, 2018 by Sushmita
• 6,890 points

Related Questions In Java

+1 vote
11 answers

How does java.net.SocketException: Connection reset happen ?

You can use wireshark to view the ...READ MORE

answered Dec 7, 2018 in Java by tushh
87,413 views
0 votes
1 answer

How to resolve the java.net.ConnectException in Java?

If you are getting java.net.ConnectionException, it means ...READ MORE

answered Jun 4, 2018 in Java by Akrati
• 3,170 points
790 views
0 votes
1 answer

how to read csv file form sftp connection and store into string object in java code and convert into json.....post it using rest api

Hey, @Pooja, Before starting with anything you should ...READ MORE

answered May 12 in Java by Roshni
• 4,590 points
492 views
+5 votes
3 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 6, 2018 by Omkar 31,367 views
+1 vote
2 answers

How to use try & catch block in Java?

Hey @Jino, Using try catch block for your ...READ MORE

answered Dec 21, 2018 in Java by Nabarupa
146 views
0 votes
1 answer

What is ArrayIndexOutOfBoundsException ?

If You check System.out.print(names.length); you will get 3 ...READ MORE

answered May 11, 2018 in Java by sharth
• 3,370 points
189 views
0 votes
2 answers

How can I solve java.lang.NoClassDefFoundError in Java?

NoClassDefFoundError means that the class is present ...READ MORE

answered Sep 11, 2018 in Java by Sushmita
• 6,890 points
5,392 views
0 votes
2 answers

What is a StackOverflow Error

stackoverflow error – StackOverflow Error in Java. This error is thrown to ...READ MORE

answered Aug 28 in Java by Pistle
• 1,000 points
329 views
0 votes
5 answers

How to compare Strings in Java?

String fooString1 = new String("foo"); String fooString2 = ...READ MORE

answered Jul 12, 2018 in Java by Daisy
• 8,110 points
300 views
0 votes
2 answers

How to round any number to n decimal places in Java?

new BigDecimal(String.valueOf(double)).setScale(yourScale, BigDecimal.ROUND_HALF_UP); will get you a BigDecimal. To ...READ MORE

answered Aug 26, 2019 in Java by Sirajul
• 58,130 points
223 views