You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by paul <tj...@fairex.com> on 2004/11/04 05:10:47 UTC

Need help to explain error

Dear all,

    While send data out via a post method, I encountered this exception, using httpclient 3.0alpha2 :
=====================================================
Nov 4, 2004 10:12:56 AM org.apache.commons.httpclient.HttpMethodDirector execute
WithRetry
INFO: Recoverable exception caught when processing request
java.lang.NullPointerException
        at org.apache.commons.httpclient.HttpConnection.isStale(HttpConnection.j
ava:460)
        at org.apache.commons.httpclient.HttpConnection.isOpen(HttpConnection.ja
va:392)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Htt
pMethodDirector.java:398)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMe
thodDirector.java:164)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:437)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:324)
        at et.component.util.HttpClientConnection.send(HttpClientConnection.java
:89)
        at org.apache.soap.messaging.Message.send(Unknown Source)
=======================================================
Seems like while checking isStale , it encounter nullpointer...this scenario happens while retrying to send data..pls help.

Thx in adv.

CONFIDENTIAL NOTE: The information contained in this email is intended only
for the use of the individual or entity named above and may contain
information that is privileged, confidential and exempt from disclosure under
applicable law. If the reader of this message is not the intended recipient,
you are hereby notified that any dissemination, distribution or copying of
this communication is strictly prohibited. If you have received this message
in error, please immediately notify the sender and delete the mail. Thank you.

Re: Need help to explain error

Posted by Oleg Kalnichevski <ol...@apache.org>.
Paul
I can't explain this error. Usually code in HttpClient is quite
defensive and we have not been getting a lot of NPEs in the past.

My only guess is that this problem is caused by a synchronization issue.
HttpConnection class is not thread safe per se. One has to use a
multi-threading safe connection manager in order to make HttpConnection
thread safe. Plausibly, isStale method called from one thread when
another thread has already closed the connection. 

This is the only explanation I can come up with

Oleg


On Thu, Nov 04, 2004 at 12:10:47PM +0800, paul wrote:
> Dear all,
> 
>     While send data out via a post method, I encountered this exception, using httpclient 3.0alpha2 :
> =====================================================
> Nov 4, 2004 10:12:56 AM org.apache.commons.httpclient.HttpMethodDirector execute
> WithRetry
> INFO: Recoverable exception caught when processing request
> java.lang.NullPointerException
>         at org.apache.commons.httpclient.HttpConnection.isStale(HttpConnection.j
> ava:460)
>         at org.apache.commons.httpclient.HttpConnection.isOpen(HttpConnection.ja
> va:392)
>         at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Htt
> pMethodDirector.java:398)
>         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMe
> thodDirector.java:164)
>         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
> a:437)
>         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
> a:324)
>         at et.component.util.HttpClientConnection.send(HttpClientConnection.java
> :89)
>         at org.apache.soap.messaging.Message.send(Unknown Source)
> =======================================================
> Seems like while checking isStale , it encounter nullpointer...this scenario happens while retrying to send data..pls help.
> 
> Thx in adv.
> 
> CONFIDENTIAL NOTE: The information contained in this email is intended only
> for the use of the individual or entity named above and may contain
> information that is privileged, confidential and exempt from disclosure under
> applicable law. If the reader of this message is not the intended recipient,
> you are hereby notified that any dissemination, distribution or copying of
> this communication is strictly prohibited. If you have received this message
> in error, please immediately notify the sender and delete the mail. Thank you.

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