Hi,
I guess the reason is explained here http://wso2.org/library/165
Something like this should solve the problem
ConfigurationContext configurationContext = ConfigurationContextFactory
.createConfigurationContextFromFileSystem(null,
null);
HttpClient httpClient = new HttpClient(
new MultiThreadedHttpConnectionManager());
configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,
Boolean.TRUE);
configurationContext
.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
Michele
On Thu, 2007-03-29 at 21:30 +0200, [EMAIL PROTECTED] wrote:
> It seems that HttpClient is the reason for the socket bind exception:
>
> Caused by: java.net.BindException: Address already in use: connect
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
> at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
> at java.net.Socket.connect(Socket.java:461)
> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> at
> org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> at
> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> at
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> at
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> at
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> at
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> at
> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:551)
> ...
>
> I can reproduce this behaviour, if I start multithreaded stub calls against a
> tomcat and restart the test after completion.
> After a period of time (< 30 seconds), the calls are running again without
> problems. Maybe HttpClient has a problem with
> local socket assignment under load test conditions?
>
> I dont think anymore, that a client-side http listener is the problem.
>
> Do you have an idea, what could be done to eliminate this behaviour?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]