3

I have a REST Web Service made with Spring MVC 3.2.0 that calls others REST Web Services also with Spring MVC. I'm having the following exception:

25-11-2014 17:49:42-ERROR-ajp-/172.23.111.22:8109-9-pe.com.dummy.BusinessDummyImpl- I/O error on POST request for "http://172.23.111.23/dummy-2/rest/method1":Unexpected end of file from server; nested exception is java.net.SocketException: Unexpected end of file from server
org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://172.23.111.23/dummy-2/rest/method1":Unexpected end of file from server; nested exception is java.net.SocketException: Unexpected end of file from server
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:499)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:447)
    at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:295)

Caused by: java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:747)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:608)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1334)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:479)
    at org.springframework.http.client.SimpleClientHttpResponse.getRawStatusCode(SimpleClientHttpResponse.java:47)
    at org.springframework.http.client.AbstractClientHttpResponse.getStatusCode(AbstractClientHttpResponse.java:32)
    at org.springframework.web.client.DefaultResponseErrorHandler.getHttpStatusCode(DefaultResponseErrorHandler.java:55)
    at org.springframework.web.client.DefaultResponseErrorHandler.hasError(DefaultResponseErrorHandler.java:49)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:485)
    ... 42 more

It happens randomly and when I check the log on dummy-2 WS there is no trace of error.

What can be causing this error?

2
  • Sounds like something outside of your server that cuts off the connection... But hard to tell without the know of what exactly are you trying to do. What does work, what have you already tried and such. Some code could also be handy. Commented Nov 26, 2014 at 0:11
  • check this. In case this doesn't help do a network trace via wireshark (or something similar tool) Commented Nov 26, 2014 at 7:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.