users@jersey.java.net

Re: [Jersey] Thread waits indefinitely using Apache HTTP based Jersey Client[WAS]Re: Problem switching to ApacheHttpClient in Jersey 1.0.2

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 23 Feb 2009 12:53:33 +0100

Hi Imran,

Drat. Are you also catching UniformInterfaceException?

I am guessing you might need to because i see:

              try {
                  final Builder type =
- webResource.path("pub-
house").type("application/xml");
+ getWebResource().path("pub-
house").type("application/xml");
                  type.post(houseElement);
                  fail("Should not succeed!"); <------
              } catch (Exception ex) { <----- Need to catch
UniformInterfaceException ?


In that case you currently have to explicitly call close on the
ClientResponse obtained from UniformInterfaceException.

Note that there is another issue [1] open related to this. In such
cases we need to buffer the response entity if such exceptions are
thrown to avoid the thread locking issue.

Paul.

[1] https://jersey.dev.java.net/issues/show_bug.cgi?id=224

On Feb 23, 2009, at 11:28 AM, Imran M Yousuf wrote:

> On Fri, Feb 20, 2009 at 4:54 PM, Paul Sandoz <Paul.Sandoz_at_sun.com>
> wrote:
>>
>> On Feb 20, 2009, at 11:44 AM, Imran M Yousuf wrote:
>>
>>> On Fri, Feb 20, 2009 at 3:19 PM, Paul Sandoz <Paul.Sandoz_at_sun.com>
>>> wrote:
>>>>
>>>> <snip />
>>>
>>> Thanks for the documentation. I had a question regarding this, when
>>> can I expect the SNAPSHOT to be available for testing?
>>>
>>
>> Now, it is continuously built. Usually, if all goes well and there
>> are no
>> test failures or networking issues, Hudson pushes out new artifacts
>> about 1
>> to 2 hours after a commit.
>>
>
> Great to learn about the build process. I have upgraded to
> 1.0.3-SNAPSHOT but the error still remains. Please find the diffs and
> thread dump in the attached files.
>
> Best regards,
>
> Imran
>
>> You can see results here:
>>
>> http://hudson.glassfish.org/job/Jersey/
>>
>> Paul.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>>
>
>
>
> --
> Imran M Yousuf
> Entrepreneur & Software Engineer
> Smart IT Engineering
> Dhaka, Bangladesh
> Email: imran_at_smartitengineering.com
> Blog: http://imyousuf-tech.blogs.smartitengineering.com/
> Mobile: +880-1711402557
> <dump.txt><0001-Change-to-apache-http-based-jersey-
> client.patch><0002-Test-freezes.patch><0003-Update-test-version-to-
> SNAPSHOT-version-of-
> Jersey
> .patch
> >---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net