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]