[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740015#action_12740015
 ] 

John Watts commented on HTTPCLIENT-799:
---------------------------------------

I found this issue while trying to research this error on my own. I know there 
won't be a fix forthcoming, but maybe this will help others who find this issue 
as well. That error message seems to be caused when 
MultiThreadedHttpConnectionManager tries to free unused connections but can't 
find the pool it belongs to in its HashMap of connection pools. The most likely 
reason for that is that the key used in the lookup is not equal to the key used 
when the connection pool was created. The key in that map is a 
HostConfiguration which, among other things, contains a ProtocolSocketFactory. 
For me, the problem was that I specified my own ProtocolSocketFactory which 
extended SSLProtocolSocketFactory. However, SSLProtocolSocketFactory implements 
equals and hashCode to consider all instances of SSLProtocolSocketFactory to be 
equal to each other and unequal to everything else. If you don't override them 
again, your subclass will have a broken implementation of equals that not only 
has a behavior you don't want, but doesn't even follow the equals contract. 
There is a caution on the superclass, ProtocolSocketFactory about implementing 
equals and hashCode that I think is supposed to prevent this sort of thing but 
it still seems a little off. So beware!

> Host connection pool not found, hostConfig=HostConfiguration for no apparent 
> reason
> -----------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-799
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-799
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 3.1 Final
>            Reporter: Craig
>            Priority: Trivial
>
> We see this come up in our logs very frequently. I see absolutely no reason 
> why this error would occur, and the error is not a result of an exception - 
> the application works without a hitch and without interruption. Here is what 
> we see in the log:
> --
> ERROR
> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
> Host connection pool not found, 
> hostConfig=HostConfiguration[host=http://localhost:8082]
> ---
> There is no stack trace or other information.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to