Alex,
You are subclassing the SimpleHttpConnectionManager which is not thread-safe. e.g. using the same SimpleHttpConnectionManager instance from different threads / method calls is not supported. Could this be the problem? What happens when you replace HAHttpConnectionManager with the SimpleHttpConnectionManager or the MultiThreadedHttpConnectionManager? (no failover of course) but are you still seeing the problem with that ones?
Ortwin Gl�ck
[EMAIL PROTECTED] wrote:
Apologies in advance if this is the incorrect mailing list.
We are trying to implement High Avaliablity with HttpClient (great package btw), we dont have the luxury of a load balancer to do this for now, so we (I) thought we could do it programmatically.
The way I thought would work, is to subclass the SimpleHttpConnectionManager and return a connection that succeeded. Below is the source for this implementation.
Everything seems to work fine, the failover succeeds and the client connects to the failover host. However, under heavy usage, and if the primary host is down, the occasional error occurs, with the exception:
Address already in use: connect
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:452)
at java.net.Socket.connect(Socket.java:402)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
