You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (Resolved) (JIRA)" <ji...@apache.org> on 2012/03/31 13:34:25 UTC

[jira] [Resolved] (HTTPCLIENT-1178) NPE thrown in DefaultUserTokenHandler

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCLIENT-1178.
-------------------------------------------

    Resolution: Invalid

Cory,
This pretty much explains it. I also looked at the exception stack traces and found out NPEs were most likely caused by concurrent modification of the context content by multilpe threads.

HttpContext instances may not be shared by multiple threads regardless whether the implementation itself is thread safe or not, as they may contain non-thread safe objects such as HttpConnection and AuthState.

Each thread of execution should have a dedicated HttpContext instance.

Oleg
                
> NPE thrown in DefaultUserTokenHandler
> -------------------------------------
>
>                 Key: HTTPCLIENT-1178
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1178
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.1.3
>            Reporter: Cory Lum
>
> java.lang.NullPointerException
> 	at org.apache.http.impl.client.DefaultUserTokenHandler.getAuthPrincipal(DefaultUserTokenHandler.java:91)
> 	at org.apache.http.impl.client.DefaultUserTokenHandler.getUserToken(DefaultUserTokenHandler.java:72)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:516)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
> 	at some.package.SomeClass.execute(SomeClass.java:123)
> -or-
> java.lang.NullPointerException
> 	at org.apache.http.impl.client.DefaultUserTokenHandler.getUserToken(DefaultUserTokenHandler.java:79)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:516)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
> 	at some.package.SomeClass.execute(SomeClass.java:123)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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