Announcement Announcement Module
No announcement yet.
RestTemplate I/O Errors and HttpClient Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • RestTemplate I/O Errors and HttpClient

    I working on a large middleware application that users RestTemplate to handle RESTful calls to about 40 different services.

    We are using HttpClient 3.1 as the ClientHttpRequestFactory and MultiThreadedHttpConnectionManager as HTTPClient's connection manage.

    We get intermittent I/O Errors as we scale to a multi-user / multi-thread environment that we do not see when running single-user tests in the development environment.

    Has anyone else experienced a similar problem? Can anyone suggest a solution or approach we might try? Should we replace HttpClient 3.1?

    The network people at the company where I'm working say that they see "out of state packets" causing their firewall to drop our connections.

    Below is a typical stack trace from an I/O Exception.

    Caused by: org.springframework.web.client.ResourceAccessExcep tion: I/O error: Read timed out; nested exception is Read timed out
    at org.springframework.web.client.RestTemplate.doExec ute(
    at org.springframework.web.client.RestTemplate.execut e(
    at org.springframework.web.client.RestTemplate.getFor Object(
    at com.nytimes.cil.service.regi.RegiServiceImpl.searc hRegiAccount(
    ... 91 more
    Caused by: Read timed out
    at Method)
    at Source)
    at (Unknown Source)
    at own Source)
    at ord(Unknown Source)
    at aRecord(Unknown Source)
    at nknown Source)
    at Source)
    at Source)
    at org.apache.commons.httpclient.HttpParser.readRawLi ne(
    at org.apache.commons.httpclient.HttpParser.readLine(
    at org.apache.commons.httpclient.HttpConnection.readL ine(
    at org.apache.commons.httpclient.MultiThreadedHttpCon nectionManager$HttpConnectionAdapter.readLine(Mult
    at org.apache.commons.httpclient.HttpMethodBase.readS tatusLine(
    at org.apache.commons.httpclient.HttpMethodBase.readR esponse(
    at org.apache.commons.httpclient.HttpMethodBase.execu te(
    at org.apache.commons.httpclient.HttpMethodDirector.e xecuteWithRetry(
    at org.apache.commons.httpclient.HttpMethodDirector.e xecuteMethod(
    at org.apache.commons.httpclient.HttpClient.executeMe thod(
    at org.apache.commons.httpclient.HttpClient.executeMe thod(
    at org.springframework.http.client.CommonsClientHttpR equest.executeInternal(CommonsClientHttpRequest.ja va:83)
    at org.springframework.http.client.AbstractClientHttp Request.execute(
    at org.springframework.web.client.RestTemplate.doExec ute(
    ... 94 more

  • #2
    Re: RestTemplate I/O Errors and HttpClient

    I have a similar problem. Does anybody have solution?