hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pradeep Avadhani" <pav...@gmail.com>
Subject Re: getResponseBodyAsString() returns chunked HTTP content instead of resolved repsonse
Date Tue, 04 Dec 2007 07:44:49 GMT
Hi,

  It took a long time to test the app after upgrading to
commons-httpclient.jar version 3.1 as suggested. Upgrading to the latest
version did not help. Occasional failures are still encountered. You have
mentioned analyzing multi-threading, but I'm not sure how to uncover them on
the client side. Any ideas?

  I engaged T-Leaf to monitor the responses (HTTP traffic) from the WebLogic
for those failure scenarios, it was found that monitoring tool had no issues
in distinguishing the HTTP header and response body. So, the problem area
can be narrowed down to commons-httpclient implementation resulting in a
random failure where the API returns HTTP content (header + chunked
responses) instead of just the response body.

  This has been one of the really tough nuts to crack. Again, I appreciate
your insights in resolving this issue. Thank you

Pradeep.


On 11/14/07, Oleg Kalnichevski <olegk@apache.org> wrote:
>
>
> On Tue, 2007-11-13 at 10:06 -0700, Pradeep Avadhani wrote:
> > Thanks for the response.
> >
> > While method.getResponseBodyAsString()  does return the XML in most
> cases
> > (as shown below)
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <Envelope>
> > ...
> > </Envelope>
> >
> > but in the cases where the failure occur method returns the following
> > content
> >
> -------------------------------------------------------------------------------------------------------------
> > HTTP/1.1 200 OK
> > Date: Tue, 06 Nov 2007 12:41:46 GMT
> > Content-Type: text/xml; charset="UTF-8"
> > Transfer-Encoding: chunked
> >
> > 0fe6
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <Envelope>
> > ...
> > </Envelope>
> > 0000
> >
> ------------------------------------------------------------------------------------------------------------
> >
> > I would like to understand the root cause of the issue before going the
> > upgrade route. Can weblogic be eliminated as a cause for this issue ?
> >
> > Pradeep A
>
> Pradeep,
>
> Symptoms you have described seem to suggest a threading issue. Are you
> calling HttpClient from multiple threads? Are you using it with a
> thread-safe connection manager?
>
> Oleg
>
> >
> > On 11/13/07, Oleg Kalnichevski <olegk@apache.org> wrote:
> >
> > >
> > > On Mon, 2007-11-12 at 11:53 -0700, Pradeep Avadhani wrote:
> > > > Hi,
> > > >
> > > > Java client application that has been in production for 2 years is
> > > running
> > > > into an issue now. Client application uses commons-httpclient.jar
> (version
> > > > 2.0.2) to communicate with weblogic 8.1 hosted J2EE app. All of a
> > > sudden, at
> > > > random failures are occuring while processing the HTTP response.
> This
> > > > behavior is sporadic and unfortunately not reproducible in the same
> or
> > > > different environment. Meaning, if the transaction that leads to the
> > > issue
> > > > is rerun, it works fine. The details of the issue are below.
> > > >
> > > > As part of the code below
> > > > ..
> > > > //create a method object
> > > > method = *new* PostMethod(*this*.config.getURL());
> > > > method.setRequestHeader("Content-type", "text/xml");
> > > > *if* (headers != *null*) {
> > > > *   for* (*int* i = 0; headers.size() > i; i++) {
> > > >       Header header = (Header)headers.get(i);
> > > >       method.setRequestHeader(header);
> > > >    }
> > > > }
> > > >
> > > > StringRequestEntity entity = *new* StringRequestEntity(request);
> > > > method.setRequestEntity(entity);
> > > >
> > > > //execute the method
> > > > client.executeMethod(method);
> > > > String result = method.getResponseBodyAsString();
> > > >
> > > > method.getResponseBodyAsString() occasionally returns HTTP content
> > > instead
> > > > of the expected XML response
> > > >
> > >
> > > What exactly do you mean by "returns HTTP content"?
> > >
> > > Anyways, please consider upgrading to HttpClient 3.1. Support for
> > > HttpClient 2.0.2 has been discontinued quite a while ago.
> > >
> > > Oleg
> > >
> > >
> > > > HTTP/1.1 200 OK
> > > > Date: Tue, 06 Nov 2007 12:41:46 GMT
> > > > Content-Type: text/xml; charset="UTF-8"
> > > > Transfer-Encoding: chunked
> > > >
> > > > 0fe6
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > > <Envelope>
> > > > …
> > > > </Envelope>
> > > > 0000
> > > > The response XML sizes vary between ~2kb to ~50Kb. Can anyone
> > > > provide insight into this odd behavior? Thanks
> > > >
> > > > Pradeep A
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> httpclient-user-help@jakarta.apache.org
> > >
> > >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message