Results 1 to 5 of 5

Thread: SimpleHttpConnectionManager being used incorrectly

  1. #1

    Default SimpleHttpConnectionManager being used incorrectly

    Hello,

    Happy New Year to everyone!

    I got a problem with my Spring-WS implementation.

    To give a quick description. It is a normal Spring Web Service where the messages are routed to an endpoint. From the endpoint I invoke a connector class which extends WebServiceGatewaySupport to invoke another Web Service.

    When I do heavy unit testing with concurrent requets I get the following error:

    SimpleHttpConnectionManager being used incorrectly. Be sure that HttpMethod.releaseConnection() is always called and that only one thread and/or method is using this connection manager at a time.

    Do I have to synchronize the invoke method of the class which extends WebServiceGatewaySupport? Or do I need to release the connection manually?

    thanks for any help,

    Tobias

  2. #2

    Default

    the only work around I found so far was to synchronize the send and receive activity:

    synchronized (logger) { getWebServiceTemplate().sendSourceAndReceiveToResu lt(request, result);
    }

  3. #3

    Default

    Are these calls not threads safe? We're seeing the exact same error and it's killing our threads on the server. Using version 1.5.9.

  4. #4
    Join Date
    Mar 2011
    Posts
    1

    Default

    Spring comes with default single thread connection manager. I have updated my client the following way:
    <bean id="httpClient" class="org.apache.commons.httpclient.HttpClient">
    <property name="params" ref="httpParams" />
    <property name="httpConnectionManager" ref="connectionManager" />
    </bean>


    <bean id="connectionManager"
    class = "org.apache.commons.httpclient.MultiThreadedHttpCo nnectionManager" />

    That fixed the problem.

  5. #5
    Join Date
    Jan 2012
    Posts
    2

    Default

    Can you tell where exactly should be inserted this code?

Posting Permissions

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