-
Jan 3rd, 2008, 12:35 PM
#1
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
-
Jan 4th, 2008, 03:10 AM
#2
the only work around I found so far was to synchronize the send and receive activity:
synchronized (logger) { getWebServiceTemplate().sendSourceAndReceiveToResu lt(request, result);
}
-
Nov 9th, 2010, 05:43 PM
#3
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.
-
Mar 30th, 2011, 03:07 PM
#4
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.
-
Jan 25th, 2012, 05:13 AM
#5
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
-
Forum Rules