title: Timeout configuration for spring webservices with RestTemplate
body: <p>I would like to configure a timeout on the client side for spring webservices using RestTemplate. I tried the following configuration :</p>
  
  <pre><code>&lt;bean id="restTemplate" class="org.springframework.web.client.RestTemplate"&gt;
  &lt;constructor-arg&gt;
      &lt;bean class="org.springframework.http.client.CommonsClientHttpRequestFactory"&gt;
      &lt;property name="readTimeout" value="10000" /&gt;
      &lt;/bean&gt;
  &lt;/constructor-arg&gt;
      &lt;property name="messageConverters"&gt;
      &lt;list&gt;
      &lt;ref bean="stringHttpMessageConverter" /&gt;
      &lt;ref bean="marshallingHttpMessageConverter" /&gt;
      &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>But I have a NoClassDefFoundError when I start my tomcat :</p>
  
  <pre><code>06 févr. 2012 10:43:43,113 [ERROR,ContextLoader] Context initialization failed
  java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethodBase
  </code></pre>
  
  <p>However I have included commons-httpclient in my pom.xml :</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;commons-httpclient&lt;/groupId&gt;
          &lt;artifactId&gt;commons-httpclient&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
      &lt;/dependency
  </code></pre>
  
  <p>Any idea of how I could do/fix that?</p>
  
  <p>Thanks in advance !</p>