Results 1 to 3 of 3

Thread: Timeout configuration for spring webservices with RestTemplate

  1. #1
    Join Date
    Feb 2012
    Posts
    1

    Default Timeout configuration for spring webservices with RestTemplate

    I would like to configure a timeout on the client side for spring webservices using RestTemplate. I tried the following configuration :

    Code:
    <bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
    <constructor-arg>
        <bean class="org.springframework.http.client.CommonsClientHttpRequestFactory">
        <property name="readTimeout" value="10000" />
        </bean>
    </constructor-arg>
        <property name="messageConverters">
        <list>
        <ref bean="stringHttpMessageConverter" />
        <ref bean="marshallingHttpMessageConverter" />
        </list>
        </property>
    </bean>
    But I have a NoClassDefFoundError when I start my tomcat :
    Code:
    06 févr. 2012 10:43:43,113 [ERROR,ContextLoader] Context initialization failed
    java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethodBase
    However I have included commons-httpclient in my pom.xml :

    Code:
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1</version>
        </dependency
    Any idea of how I could do/fix that?

    Thanks in advance !

  2. #2
    Join Date
    May 2011
    Location
    Madrid (Spain)
    Posts
    101

    Default

    Hi, try to generate a .war with that .jar included in WEB-INF/lib, and deploy it in tomcat.

  3. #3
    Join Date
    Feb 2013
    Posts
    4

    Default Any luck?

    Any luck ?

    Thanks,
    Stitaprajna

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •