I am running HttpClient successfully in a multithreaded environment, using
Java 1.5 and HttpClient 3.0 rc3. My app also uses cookies. My original
implementation used a single HttpState to get the cookies. I worried about
how to keep the cookies separate for all threads, so I switched my client
call to use HttpClient.execute(HostConfiguration, PostMethod, HttpState).

Each thread has its own state, so you are guaranteed that the cookies for
each thread are correct. I don't know if this is how you're running, but it
works for me.

--Steve

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 11, 2005 12:05 PM
To: [email protected]
Subject: java 1.5 multithreaded problem

I am trying to run an existing application that uses HttpClient, with a
new JVM.  Previously, I was using java 1.4.1, now I am trying to use
java 1.5.0.  Additionally, I updated from httpclient 2.0 to httpclient
3.0 rc 3.

The program I am trying to use (and I'm a developer of the application
too) is webtester, http://webtester.sourceforge.net.   I upgraded the
application to use httpclient 3.0 rc 3, and this worked fine under java 1.4.

When I try to run it under java 1.5, however, the httpclient classes
seem to function differently somehow.  Namely, when I run the
application in a multithreaded environment, cookies do not seem to be
persistent.  

I was wondering if anyone else has had a problem with using httpclient,
in a multithreaded environment, with java 1.5?  I examined the list of
changes for java 1.5, and httpclient 3.0, and did not identify anything
obvious which would explain this.

If I need to provide more information, or if I am posting to the wrong
mailing list, then my apologies in advance.

Thank you.

---------------------------------------------------------------------
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]

Reply via email to