DO NOT REPLY [Bug 31471] - HostConfiguration handling requires cleanup

2004-10-05 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31471.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31471

HostConfiguration handling requires cleanup





--- Additional Comments From [EMAIL PROTECTED]  2004-10-05 09:12 ---
In addition to previous changes I refactored virtual host logic out of
HttpConnection and HostConfiguration classes and moved it to the
HttpMethodParams  HostParams. Basically, virtual host has absolutely nothing to
do with the physical connection and should not have been there in the first
place. Let me know what you think

Oleg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



HttpClient query...

2004-10-05 Thread Srinivas Velidanda
Hi,
 
I am using HttpClient (commons-httpclient-3.0-alpha2) api for file upload.
 
How to handle a session if I am creating a MultipartPost request in a JSP and posting 
the request using client.executeMethod(mPost) to a servlet URL. 
 
Once I send the request the session is getting killed and could not pass on the 
request to a specific handler in sequence..
 
Pl. let me know how to handle the session, if possible send me some sample code for 
that.
 
thanks in advance..
 
Srinivas.
 


-
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

Re: HttpClient query...

2004-10-05 Thread Roland Weber
Hello Srinivas,

if the session is handled by a session cookie, just make sure
you use the same HttpState object for all requests. That should
happen automagically if you do nothing special and re-use one
HttpClient for all requests.

If the server uses URL rewriting because it believes that the
client can't handle cookies, you have a problem. You will have
to parse server responses in order to extract URLs with the
session information encoded in them. Or convince the server
to send cookies.

hope that helps,
  Roland





Srinivas Velidanda [EMAIL PROTECTED] 
05.10.2004 13:32
Please respond to
Commons HttpClient Project


To
[EMAIL PROTECTED]
cc

Subject
HttpClient query...






Hi,
 
I am using HttpClient (commons-httpclient-3.0-alpha2) api for file upload.
 
How to handle a session if I am creating a MultipartPost request in a JSP 
and posting the request using client.executeMethod(mPost) to a servlet 
URL. 
 
Once I send the request the session is getting killed and could not pass 
on the request to a specific handler in sequence..
 
Pl. let me know how to handle the session, if possible send me some sample 
code for that.
 
thanks in advance..
 
Srinivas.
 

 
-
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!


Re: HttpClient query...

2004-10-05 Thread Srinivas Velidanda
Hi Roland, 
thanks for the reply.
 
I am new to this API and pl let me know how can I do the following.
 
1. can I set the same parameters coming from the session before creating Multipart 
request to the Multipart request, if yes, how can I set and how can these parameters 
can be referred at the server side.
 
2.I am getting the session parameters in the JSP where I am creating Multipart 
request, but once I post the Multipart request to the server the session is getting 
killed.
 
We are not working with cookies.
 
Is there a solution without using cookies or I must go for cookies..
 
thanks,
 
Srinivas

Roland Weber [EMAIL PROTECTED] wrote:
Hello Srinivas,

if the session is handled by a session cookie, just make sure
you use the same HttpState object for all requests. That should
happen automagically if you do nothing special and re-use one
HttpClient for all requests.

If the server uses URL rewriting because it believes that the
client can't handle cookies, you have a problem. You will have
to parse server responses in order to extract URLs with the
session information encoded in them. Or convince the server
to send cookies.

hope that helps,
Roland





Srinivas Velidanda 
05.10.2004 13:32
Please respond to
Commons HttpClient Project


To
[EMAIL PROTECTED]
cc

Subject
HttpClient query...






Hi,

I am using HttpClient (commons-httpclient-3.0-alpha2) api for file upload.

How to handle a session if I am creating a MultipartPost request in a JSP 
and posting the request using client.executeMethod(mPost) to a servlet 
URL. 

Once I send the request the session is getting killed and could not pass 
on the request to a specific handler in sequence..

Pl. let me know how to handle the session, if possible send me some sample 
code for that.

thanks in advance..

Srinivas.



-
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!


-
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

Unlocatable exception within httpclient.HttpRecoverableException

2004-10-05 Thread Jeff Fern
Hello all,

I am running Tomcat 5.0.27 with Java 1.4.2 on my local machine (Debian
sarge). I have a Java webapp running on Tomcat, which outputs XML and I am
using Cocoon 2.1 to style the XML with a static XSLT stylesheet to generate
HTML.

I have managed to generate an bug which occurs about 80% of the time.

When I submit a form, cocoon generates one of a couple of errors:

org.apache.cocoon.ProcessingException: There is a problem with the URI:

 
http://127.0.0.1:8080/Conference/GetConference?conferenceName=UbiComp%20200
5
http://127.0.0.1:8080/Conference/GetConference?conferenceName=UbiComp%202005
:

org.apache.commons.httpclient.HttpRecoverableException:

org.apache.commons.httpclient.HttpRecoverableException: Error in parsing the
status line from the response: unable to find line starting with HTTP

or org.apache.cocoon.ProcessingException: There is a problem with the

URI:  http://127.0.0.1:8080/Conference/AddDetails
http://127.0.0.1:8080/Conference/AddDetails:

org.apache.commons.httpclient.HttpRecoverableException:

java.net.SocketException: Socket closed

Trying to re-submit the same information sometimes displays the correct
results, sometimes generates an error.

I have enabled logging with log4j using the examples at
http://jakarta.apache.org/commons/httpclient/logging.html
http://jakarta.apache.org/commons/httpclient/logging.html The only ouput
generated in the log file is:

- Recoverable exception caught when processing request

- Recoverable exception caught but MethodRetryHandler.retryMethod()

returned false, rethrowing exception

I have also tried my code on Tomcat 5.5 with Java 1.5 and get the exact same
results.

I am unable to locate any piece of my code that causes this error.

Any help or suggestions would be much appreciated,

Regards,

 

 

 

 

-Jeff Fern



Re: HttpClient query...

2004-10-05 Thread Roland Weber
Hello Srinivas,

you are using HttpClient from within a JSP to connect to
the server that is running the JSP? Or to a different server?

If you want to set request parameters, you don't do that
before creating the multipart request. You create the
multipart request, then add the parameters using
MP.addParameter(..) or MP.addPart(...).
Just make sure to add all required parameters before
you *execute* the method. See also the web site at

http://jakarta.apache.org/commons/httpclient/methods/multipartpost.html

The sample code for multipart file upload is for the
2.0 API, but it should be helpful anyway. Go straight
to the actionPerformed method:

http://cvs.apache.org/viewcvs.cgi/jakarta-commons/httpclient/src/examples/?only_with_tag=HTTPCLIENT_2_0_BRANCH

cheers,
  Roland





Srinivas Velidanda [EMAIL PROTECTED] 
05.10.2004 14:00
Please respond to
Commons HttpClient Project


To
Commons HttpClient Project [EMAIL PROTECTED]
cc

Subject
Re: HttpClient query...






Hi Roland, 
thanks for the reply.
 
I am new to this API and pl let me know how can I do the following.
 
1. can I set the same parameters coming from the session before creating 
Multipart request to the Multipart request, if yes, how can I set and how 
can these parameters can be referred at the server side.
 
2.I am getting the session parameters in the JSP where I am creating 
Multipart request, but once I post the Multipart request to the server the 
session is getting killed.
 
We are not working with cookies.
 
Is there a solution without using cookies or I must go for cookies..
 
thanks,
 
Srinivas

Roland Weber [EMAIL PROTECTED] wrote:
Hello Srinivas,

if the session is handled by a session cookie, just make sure
you use the same HttpState object for all requests. That should
happen automagically if you do nothing special and re-use one
HttpClient for all requests.

If the server uses URL rewriting because it believes that the
client can't handle cookies, you have a problem. You will have
to parse server responses in order to extract URLs with the
session information encoded in them. Or convince the server
to send cookies.

hope that helps,
Roland





Srinivas Velidanda 
05.10.2004 13:32
Please respond to
Commons HttpClient Project


To
[EMAIL PROTECTED]
cc

Subject
HttpClient query...






Hi,

I am using HttpClient (commons-httpclient-3.0-alpha2) api for file upload.

How to handle a session if I am creating a MultipartPost request in a JSP 
and posting the request using client.executeMethod(mPost) to a servlet 
URL. 

Once I send the request the session is getting killed and could not pass 
on the request to a specific handler in sequence..

Pl. let me know how to handle the session, if possible send me some sample 

code for that.

thanks in advance..

Srinivas.



-
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

 
-
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.


Re: Unlocatable exception withinhttpclient.HttpRecoverableException

2004-10-05 Thread Oleg Kalnichevski

Jeff,

Sometimes, usually when under heavy load, the web server may be able to
receive requests but unable to process them due to low resources (most
commonly worker threads). In such a case the web server may simply have
no other choice but to drop the connection without sending back any
status code. This in turn causes HttpClient to throw a
HttpRecoverableException unable to find line starting with HTTP

Can it be that you have been stressing the server a bit too much?

Anyways, usually unable to find line starting with HTTP exception is
not a HttpClient fault, but that of the target server. The regrettable
thing about it it is a poor choice of exception class name and a
misleading error message. (This problem has already been fixed in
HttpClient 3.0)

Hope this helps a little

Oleg

On Tue, 2004-10-05 at 08:27, Jeff Fern wrote:
 Hello all,
 
 I am running Tomcat 5.0.27 with Java 1.4.2 on my local machine (Debian
 sarge). I have a Java webapp running on Tomcat, which outputs XML and I am
 using Cocoon 2.1 to style the XML with a static XSLT stylesheet to generate
 HTML.
 
 I have managed to generate an bug which occurs about 80% of the time.
 
 When I submit a form, cocoon generates one of a couple of errors:
 
 org.apache.cocoon.ProcessingException: There is a problem with the URI:
 
  
 http://127.0.0.1:8080/Conference/GetConference?conferenceName=UbiComp%20200
 5
 http://127.0.0.1:8080/Conference/GetConference?conferenceName=UbiComp%202005
 :
 
 org.apache.commons.httpclient.HttpRecoverableException:
 
 org.apache.commons.httpclient.HttpRecoverableException: Error in parsing the
 status line from the response: unable to find line starting with HTTP
 
 or org.apache.cocoon.ProcessingException: There is a problem with the
 
 URI:  http://127.0.0.1:8080/Conference/AddDetails
 http://127.0.0.1:8080/Conference/AddDetails:
 
 org.apache.commons.httpclient.HttpRecoverableException:
 
 java.net.SocketException: Socket closed
 
 Trying to re-submit the same information sometimes displays the correct
 results, sometimes generates an error.
 
 I have enabled logging with log4j using the examples at
 http://jakarta.apache.org/commons/httpclient/logging.html
 http://jakarta.apache.org/commons/httpclient/logging.html The only ouput
 generated in the log file is:
 
 - Recoverable exception caught when processing request
 
 - Recoverable exception caught but MethodRetryHandler.retryMethod()
 
 returned false, rethrowing exception
 
 I have also tried my code on Tomcat 5.5 with Java 1.5 and get the exact same
 results.
 
 I am unable to locate any piece of my code that causes this error.
 
 Any help or suggestions would be much appreciated,
 
 Regards,
 
  
 
 
 
 
 
 
 
 -Jeff Fern

***
The information in this email is confidential and may be legally privileged.  Access 
to this email by anyone other than the intended addressee is unauthorized.  If you are 
not the intended recipient of this message, any review, disclosure, copying, 
distribution, retention, or any action taken or omitted to be taken in reliance on it 
is prohibited and may be unlawful.  If you are not the intended recipient, please 
reply to or forward a copy of this message to the sender and delete the message, any 
attachments, and any copies thereof from your system.
***

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Timeouts

2004-10-05 Thread Vijay
Thanks Mike,

Our integration partner had suggested to put a send timeout also.
Its a huge multi part request. I'm not sure about the background on
this.

Thanks
Vijay


On Mon, 4 Oct 2004 22:49:05 -0400, Michael Becke [EMAIL PROTECTED] wrote:
 Hi Vijay,
 
 Send timeout is not something that Java Sockets support natively, and
 as such has not been added to HttpClient.  It would be possible to
 implement this kind of functionality but it would require a second
 thread to poll the executing thread.  The HttpMethod.abort() method
 in HttpClient 3.0 could be particularly useful for this.
 
 Do you have a particular use in mind?
 
 Mike
 
 
 
 On Oct 4, 2004, at 1:24 PM, Vijay wrote:
 
  Sorry if this is a very basic question:
 
  I would like to set 3 timeouts (connect, send and receive). I found
  the following in HttpClient package.
 
  HttpClient.setTimeout -- sets socket RECEIVE timeout
  HttpClient.setConnectionTimeout -- sets socket CONNECT timeout
 
  Is there any method available for setting socket SEND timeout?
 
  Thanks
  Vijay
 
  -
  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]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [VOTE] 2.0.2 release

2004-10-05 Thread Eric Johnson
Am I mistaken, or have the recent issues been dealt with?
-Eric.
Michael Becke wrote:
Looks like 2.0.2 has been cancelled for the moment. I'll call for a 
vote again after we fix the recently discovered issues.

Mike
On Sep 29, 2004, at 11:05 AM, Michael Becke wrote:
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [VOTE] 2.0.2 release

2004-10-05 Thread Michael Becke
Sounds like you're ready for a release :)  I'll call for a vote again 
in a moment.

Mike
On Oct 5, 2004, at 6:33 PM, Eric Johnson wrote:
Am I mistaken, or have the recent issues been dealt with?
-Eric.
Michael Becke wrote:
Looks like 2.0.2 has been cancelled for the moment. I'll call for a 
vote again after we fix the recently discovered issues.

Mike
On Sep 29, 2004, at 11:05 AM, Michael Becke wrote:
-
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]


DO NOT REPLY [Bug 31471] - HostConfiguration handling requires cleanup

2004-10-05 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31471.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31471

HostConfiguration handling requires cleanup





--- Additional Comments From [EMAIL PROTECTED]  2004-10-06 02:55 ---
Hi Oleg,

This looks much better.  Thanks for persevering on this problem.  My only question is 
if we need the 
HttpHost as part of the HttpMethod interface.  Though it's not quite as elegant, 
getUri() should be able 
to take care of all our needs.

Mike

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [VOTE] 2.0.2 release

2004-10-05 Thread Michael Becke
+1
Also I'm counting +1 for Odi as per his email when he left for vacation.
Mike
On Oct 5, 2004, at 9:48 PM, Michael Becke wrote:
After a little delay...  I propose that we mark the latest code in CVS  
HTTPCLIENT_2_0 as 2.0.2  and proceed with a release.  Please vote as  
follows:
--- 
---
 Vote:  HttpClient 2.0.2 release
 [ ] +1 I am in favor of the release, and will help support it.
 [ ] +0 I am in favor of the release, but am unable to help support it.
 [ ] -0 I am not in favor of the release.
 [ ] -1 I am against this proposal (must include a reason).
   
--- 
---

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


Re: [VOTE] 2.0.2 release

2004-10-05 Thread Dion Gillard
+0


On Tue, 5 Oct 2004 21:48:02 -0400, Michael Becke [EMAIL PROTECTED] wrote:
 After a little delay...  I propose that we mark the latest code in CVS
 
 
 HTTPCLIENT_2_0 as 2.0.2  and proceed with a release.  Please vote as
 follows:
 
 --
   Vote:  HttpClient 2.0.2 release
   [ ] +1 I am in favor of the release, and will help support it.
   [ ] +0 I am in favor of the release, but am unable to help support it.
   [ ] -0 I am not in favor of the release.
   [ ] -1 I am against this proposal (must include a reason).
 
 
 --
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
http://www.multitask.com.au/people/dion/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 31378] - Move multipart request to a new RequestEntity type

2004-10-05 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31378.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31378

Move multipart request to a new RequestEntity type





--- Additional Comments From [EMAIL PROTECTED]  2004-10-06 03:45 ---
Thanks for the feedback Odi, Oleg.  I've applied this patch after fixing the encoding 
problem and 
adding a few docs.  The use of a serial number in the boundary has been left out for 
now, but can be 
easily added in the future.  Also, a multipart tutorial using the new entity still 
needs to be written.  I'll 
leave this bug open until those items are resolved.

Mike

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Unlocatable exception withinhttpclient.HttpRecoverableException

2004-10-05 Thread Michael Becke
Hi Jeff,
Is it possible that you're using the same HttpConnection from more than  
one thread/method?  Is the same SimpleHttpConnectionManager being  
shared?

If not I would suggest disabling connection reuse.  This can usually be  
done by setting the following header on each method.

method.setRequestHeader(Connection, close);
Mike
On Oct 5, 2004, at 6:05 PM, Jeff Fern wrote:
Hello,
Thank-you for your reply.  I do not believe that the errors can be  
caused
due to the server being overloaded - it is my desktop machine and the  
only
person accessing the web server is myself. Additionally, the machine  
is not
doing anything intensive (just running X, firefox and eclipse), it is  
an
Athlon 2800+ with 512MB RAM.

The fact that I also get a socket closed message as well as unable to  
find
line starting with HTTP is also confusing me :/

Regards,
-Jeff Fern
-Original Message-
From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED]
Sent: 05 October 2004 13:51
To: Commons HttpClient Project
Cc: Jeff Fern
Subject: Re: Unlocatable exception  
withinhttpclient.HttpRecoverableException

Jeff,
Sometimes, usually when under heavy load, the web server may be able to
receive requests but unable to process them due to low resources (most
commonly worker threads). In such a case the web server may simply  
have no
other choice but to drop the connection without sending back any status
code. This in turn causes HttpClient to throw a  
HttpRecoverableException
unable to find line starting with HTTP

Can it be that you have been stressing the server a bit too much?
Anyways, usually unable to find line starting with HTTP exception  
is not
a HttpClient fault, but that of the target server. The regrettable  
thing
about it it is a poor choice of exception class name and a misleading  
error
message. (This problem has already been fixed in HttpClient 3.0)

Hope this helps a little
Oleg
On Tue, 2004-10-05 at 08:27, Jeff Fern wrote:
Hello all,
I am running Tomcat 5.0.27 with Java 1.4.2 on my local machine (Debian
sarge). I have a Java webapp running on Tomcat, which outputs XML and
I am using Cocoon 2.1 to style the XML with a static XSLT stylesheet
to generate HTML.
I have managed to generate an bug which occurs about 80% of the time.
When I submit a form, cocoon generates one of a couple of errors:
org.apache.cocoon.ProcessingException: There is a problem with the  
URI:

http://127.0.0.1:8080/Conference/GetConference?conferenceName=UbiComp
%20200
5
http://127.0.0.1:8080/Conference/GetConference?conferenceName=UbiComp%
202005
:
org.apache.commons.httpclient.HttpRecoverableException:
org.apache.commons.httpclient.HttpRecoverableException: Error in
parsing the status line from the response: unable to find line  
starting
with HTTP
or org.apache.cocoon.ProcessingException: There is a problem with the
URI:  http://127.0.0.1:8080/Conference/AddDetails
http://127.0.0.1:8080/Conference/AddDetails:
org.apache.commons.httpclient.HttpRecoverableException:
java.net.SocketException: Socket closed
Trying to re-submit the same information sometimes displays the
correct results, sometimes generates an error.
I have enabled logging with log4j using the examples at
http://jakarta.apache.org/commons/httpclient/logging.html
http://jakarta.apache.org/commons/httpclient/logging.html The only
ouput generated in the log file is:
- Recoverable exception caught when processing request
- Recoverable exception caught but MethodRetryHandler.retryMethod()
returned false, rethrowing exception
I have also tried my code on Tomcat 5.5 with Java 1.5 and get the
exact same results.
I am unable to locate any piece of my code that causes this error.
Any help or suggestions would be much appreciated,
Regards,




-Jeff Fern
*** 
*
***
The information in this email is confidential and may be legally  
privileged.
Access to this email by anyone other than the intended addressee is
unauthorized.  If you are not the intended recipient of this message,  
any
review, disclosure, copying, distribution, retention, or any action  
taken or
omitted to be taken in reliance on it is prohibited and may be  
unlawful.  If
you are not the intended recipient, please reply to or forward a copy  
of
this message to the sender and delete the message, any attachments,  
and any
copies thereof from your system.
*** 
*
***

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