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?

Alex K
  • 8,269
  • 9
  • 39
  • 57
Jose
  • 91
  • 1
  • 4
  • 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. – yair Nov 26 '14 at 00:11
  • check [this](http://stackoverflow.com/a/22478781/1910582). In case this doesn't help do a network trace via wireshark (or something similar tool) – Bond - Java Bond Nov 26 '14 at 07:28

0 Answers0