users@jersey.java.net

[Jersey] Re: Jersey HTTP requests are sent twice, why?

From: Pulkit Singhal <pulkitsinghal_at_gmail.com>
Date: Wed, 15 Aug 2012 12:29:42 -0500

Since I still did not (and do not) have the ssl private key to decrypt the
actual traffic, I decided to challenge my assumption: "jersey-client code
works as standalone but not inside jersey-servlet" ... and it turns out
that there had been enough changes in my code since then ... that I was
wrong! My code didn't work anywhere :(

@Rahul
So I pondered over your advice and set:

clientConfig.getProperties().put(
  ApacheHttpClient4Config.PROPERTY_PREEMPTIVE_BASIC_AUTHENTICATION,
  true);

And everything worked out :)

Cheers!

On Wed, Aug 15, 2012 at 11:08 AM, Pulkit Singhal <pulkitsinghal_at_gmail.com>wrote:

> @Rahul
>
>> Can you try to remove SSL, authentication and see if it makes a
>> difference?
>>
> No I can't remove SSL, the webservice I'm calling is not really under my
> control.
>
> Once again its really weird that if I run the same jersey-client code as a
> standalone java program, there are no problems. But when I try to broker
> the communication between other clients and the webservice by acting as a
> man-in-the-middle via the jersey-servlet ... then this issue pops up. Has
> there ever been any history of jersey-client and jersey-server butting
> heads when running on tomcat, in the past?
>