rest – Getting java.io.IOException: An existing connection was forcibly closed by the remote host

rest – Getting java.io.IOException: An existing connection was forcibly closed by the remote host

Such behavior could be explained if the HTTP Client you use opens persistent connections to the server, and the server occasionally terminates them.

Normally, the connection to an HTTP server is closed after each response. With HTTP keep-alive you keep the underlying TCP connection open until certain criteria are met. What those conditions are depends on the server, which is free to close the connection after an arbitrary timeout or number of requests (just as long as it returns the response to the current request).

When the server closes such a connection the client usually reopens it again, and depending on implementation, may throw an exception or print a warning.

For example, Vert.x HttpClient (which opens persistent connections by default) also throws…

java.io.IOException: An existing connection was forcibly closed by the remote host

…when the server terminates them.

I had this error when consuming my API from an outside PC, but when calling from the same PC it worked fine.

To fix to, I went to Control Panel
Right click in Java icon
Go to Advanced Tab

Then check Enable Operating Systems restricted environment
Apply and Save

enter

This fixed my problem.

rest – Getting java.io.IOException: An existing connection was forcibly closed by the remote host

I have faced same issue on windows server.
Then I checked memory utilization of server and it taking more memory so my application is not running.
I have singoff some user profile from

Task Manager–>Users Tab–> Right click and Sign Off

This solution worked for me.

Leave a Reply

Your email address will not be published.