You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Tobias Oberlies (JIRA)" <ji...@apache.org> on 2016/04/05 10:54:25 UTC

[jira] [Commented] (HTTPCLIENT-1279) NullPointerException (apparently) when authenticating

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

Tobias Oberlies commented on HTTPCLIENT-1279:
---------------------------------------------

The stacktrace from a 4.1.3 httpclient in this case is
{noformat}
java.lang.NullPointerException
	at org.apache.http.impl.client.DefaultRequestDirector.updateAuthState(DefaultRequestDirector.java:1211)
	at org.apache.http.impl.client.DefaultRequestDirector.handleResponse(DefaultRequestDirector.java:1131)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:492)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
{noformat}

I searched for this bug but had a hard time to find it because the stack trace was missing.

> NullPointerException (apparently) when authenticating
> -----------------------------------------------------
>
>                 Key: HTTPCLIENT-1279
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1279
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2.2
>            Reporter: Sebastiano Vigna
>             Fix For: 4.2.3
>
>
> Run the following class. This is likely to be a badly configured server, but DefaultHttpClient should not in any case throw a NPE.
> import org.apache.http.client.ResponseHandler;
> import org.apache.http.client.HttpClient;
> import org.apache.http.client.methods.HttpGet;
> import org.apache.http.impl.client.BasicResponseHandler;
> import org.apache.http.impl.client.DefaultHttpClient;
> public class Bug {
>     public final static void main(String[] args) throws Exception {
>         HttpClient httpclient = new DefaultHttpClient();
>         HttpGet httpget = new HttpGet("http://www.gruppotirrenia.it/robots.txt");
> 		httpclient.execute(httpget);
> 	}
> }



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

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