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

Oleg Kalnichevski commented on HTTPCLIENT-1586:
-----------------------------------------------

PlainSocketFactory is not referenced by any of non-deprecated classes in HC as 
of version 4.3. The class has even been moved to java-deprecated source 
directory to help ensure proper separation from production code.

Here is the stack trace I am getting with your code. It looks reasonable enough 
to me
{noformat}
Exception in thread "main" org.apache.http.conn.HttpHostConnectException: 
Connect to localhost:777 [localhost/127.0.0.1] failed: Connection refused
        at 
org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:142)
        at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:319)
        at 
org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
        at 
org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
        at 
org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
        at 
org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
        at 
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
        at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
        at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
        at Testing.main(Testing.java:11)
{noformat}

Oleg

> Enrich ConnectException with remoteAddress
> ------------------------------------------
>
>                 Key: HTTPCLIENT-1586
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1586
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpConn
>    Affects Versions: 4.4 Beta1
>            Reporter: Gerhard Poul
>            Priority: Minor
>         Attachments: httpclient-1586-patch1.patch
>
>
> When a ConnectException is thrown by Java it only contains information like 
> "connection refused", but not the remoteAddress that we tried connecting to 
> and while some code paths in HttpClient log this as info the core Exception 
> is just propagated to the end-user.
> I propose to either change the description of the original ConnectException 
> or create a new httpclient-specific ConnectException like java.rmi does.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to