hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebastiano Vigna (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1498) "java.lang.IllegalArgumentException: Host name may not be blank" thrown during redirect (regression?)
Date Sat, 26 Apr 2014 06:53:16 GMT

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

Sebastiano Vigna commented on HTTPCLIENT-1498:

Well, from the viewpoint of the user of the library there's no other way to tell true HttpClient
bugs (like the ones we reported in the past) from protocol errors.

I expect the library to throw an unchecked exception *only* because of actual bugsā€”null
pointers, etc.

I expect the library to throw only *checked* exception when there are errors in the protocol.

In fact, I should be able to use the library assuming that it never throws an unchecked exception.
The alternative is to use a catch-all clause and, inside, trying desperately to guess what
caused the exception by looking at the stack trace. I don't think is a good way of handling
protocol errors.

> "java.lang.IllegalArgumentException: Host name may not be blank" thrown during redirect
> -----------------------------------------------------------------------------------------------------
>                 Key: HTTPCLIENT-1498
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1498
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.3.3
>            Reporter: Sebastiano Vigna
> The bug we reported some time ago about null hosts in redirects seems to have regressed,
albeit the old problem was with "null" and the new problem is with "blank":
> 2014-04-20 04:20:09,169 19319369 ERROR [FetchingThread-197] i.u.d.l.b.f.FetchingThread
- Unexpected exception
> java.lang.IllegalArgumentException: Host name may not be blank
>         at org.apache.http.util.Args.notBlank(Args.java:68) ~[httpcore.jar:4.3.2]
>         at org.apache.http.HttpHost.<init>(HttpHost.java:81) ~[httpcore.jar:4.3.2]
>         at org.apache.http.client.utils.URIUtils.extractHost(URIUtils.java:370) ~[httpclient.jar:4.3.3]
>         at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:132)
>         at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
>         at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
>         at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:214)
>         at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:185)
>         at it.unimi.di.law.bubing.util.FetchData.fetch(FetchData.java:322) ~[bubing-0.9.3.jar:na]
> This is caused by this site:
> > wget --max-redirect=0 http://www.thegamersedge.co.uk/robots.txt
> --2014-04-20 20:47:43--  http://www.thegamersedge.co.uk/robots.txt
> Resolving www.thegamersedge.co.uk (www.thegamersedge.co.uk)...,
> Connecting to www.thegamersedge.co.uk (www.thegamersedge.co.uk)||:80... connected.
> HTTP request sent, awaiting response... 302 Moved Temporarily
> Location: http://robots.txt [following]
> 0 redirections exceeded.

This message was sent by Atlassian JIRA

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

View raw message