Hi Oleg,


Actually, I turned the wire log on to confirm the 'nullified' parameters 
encoding: I got this trace:

Wire|0| DEBUG | http://130.211.1.96/ccxmlsession_96_830_110700/event_288797 >> 
"null=null&null=null"



So I added a PostMethod dump before and after the 
httpclient.executeMethod(postMethodM) invocation to check the parameter 
validity: I got the expected values:

EventSender|0| DEBUG | 
http://130.211.1.96/ccxmlsession_96_830_110700/event_288797   0/ 
eventname=undefined

EventSender|0| DEBUG | 
http://130.211.1.96/ccxmlsession_96_830_110700/event_288797   1/ 
session.id=http://130.211.1.96/ccxmlsession_96_830_110700



As per multithreading support, I understand from this page 
http://hc.apache.org/httpclient-3.x/threading.html that 
MultiThreadedHttpConnectionManager brings thread safe http clients; am I wrong?



Thanks again.



          Dominique



-----Original Message-----
From: sebb [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2008 5:15 PM
To: HttpClient User Discussion
Subject: Re: Httpclient 3.1 encodes null=null parameters under stressing 
conditions



On 11/12/2008, Oleg Kalnichevski <[EMAIL PROTECTED]> wrote:

> On Wed, 2008-12-10 at 13:33 +0000, Domet De Mont, Dominique (d3m) wrote:

>  > Dear List,

>  >

>  > I am facing a strange httpclient 3.1 behaviour under stressing conditions 
> while encoding a post: the set of parameters is "nullified", whereas the 
> number of parameters is correct.

>  >

>  > I have turned on the httpclient wire traces to get more clues, and added 
> in my own code a dump of the PostMethod object before and after the 
> httpclient.execute call: I see the actual parameters correctly set in the 
> PostMethod object, but actually the httpclient encoding "nullified" 
> parameters.

>  >

>  > Here is the code excerpt:

>  > synchronized(this) {

>  >     // Check parameters before call

>  >     log.debug("About to call httpclient.executeMethod on object: " + 
> postMethodM + " containing parameters: " );

>  >     for(int i=0; i < postMethodM.getParameters().length; i++)

>  >         log.debug("\t" + i + "/ " + 
> postMethodM.getParameters()[i].getName() + "=" + 
> postMethodM.getParameters()[i].getValue() );

>  >     // actually call

>  >     statusCodeM = httpclient.executeMethod(postMethodM);

>  >     // check parameters after call

>  >     log.debug("Called httpclient.executeMethod on object: " + postMethodM 
> + " with status: " + statusCodeM + " containing parameters: " );

>  >     for(int i=0; i < postMethodM.getParameters().length; i++)

>  >         log.debug("\t" + i + "/ " + 
> postMethodM.getParameters()[i].getName() + "=" + 
> postMethodM.getParameters()[i].getValue() );

>  > }

>  >

>

>

> Do not do that. HttpMethods are not threading safe.



Not sure I follow - surely it is OK to call the methods in the same

thread, as in the sample above?



> Just turn on the

>  wire log if you need to examine what gets sent across the wire.

>

>  Oleg

>

>

>  ---------------------------------------------------------------------

>  To unsubscribe, e-mail: [EMAIL PROTECTED]

>  For additional commands, e-mail: [EMAIL PROTECTED]

>

>



---------------------------------------------------------------------

To unsubscribe, e-mail: [EMAIL PROTECTED]

For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to