users@jersey.java.net

Problem switching to ApacheHttpClient in Jersey 1.0.2

From: Imran M Yousuf <imyousuf_at_smartitengineering.com>
Date: Tue, 17 Feb 2009 12:57:22 +0600

Hi,

I am trying to integrate Spring Security with Jersey and in the client
part I am trying to use Jersey Client and in order to make
authentication easier I am trying to use jersey-contrib's
jersey-apache-client. Before integrating the client I was getting HTTP
Status 401 (as expected) and after integrating it I am getting the
following exception:
com.sun.jersey.api.client.ClientHandlerException:
org.apache.commons.httpclient.ProtocolException: Unbuffered entity
enclosing request can not be repeated.
The full stacktrace is in the attached
"com.smartitengineering.bookstore.ws.server.BookStoreResourcesTest.txt"
file. The attached Java file is the source of the test file and the
attached patch file is the diff for integrating the apache http based
client.

I would be grateful if someone could please guide me in fixing the
problem. Any suggestion is most welcome. The complete source code is
available at -
http://repo.or.cz/w/smart-bookstore.git?a=shortlog;h=refs/heads/auth

-- 
Imran M Yousuf
Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: imran_at_smartitengineering.com
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557