Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 38640 invoked from network); 16 Jun 2005 11:33:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jun 2005 11:33:18 -0000 Received: (qmail 7313 invoked by uid 500); 16 Jun 2005 11:33:18 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 7278 invoked by uid 500); 16 Jun 2005 11:33:17 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Delivered-To: moderator for httpclient-user@jakarta.apache.org Received: (qmail 79684 invoked by uid 99); 16 Jun 2005 10:28:55 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=HTML_20_30,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Message-ID: <003b01c5725e$d6bfbf30$1e00a8c0@ECS1> From: "Amol Kulkarni" To: Cc: Subject: Problem with HttpConnectionManager Date: Thu, 16 Jun 2005 16:03:23 +0530 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0037_01C5728C.EC01DC60" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0037_01C5728C.EC01DC60 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0038_01C5728C.EC01DC60" ------=_NextPart_001_0038_01C5728C.EC01DC60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi , I am using HttpClient as a Proxy Recorder i.e. An request made through = Browser goes through my code and I am using HttpClient to fire the = browser request. The response that I get from HttpMethod is written back = to the Browser. I facing a problem (which I feel is a bug in = HttpClient). To test my Proxy Recorder I have configured the PetStore demo. Very briefly, The first URL that I fire (or execute using HttpClient) is = http://localhost:8080/petstore/signon_welcome.screen [DEBUG] header - >> "GET /petstore/signon_welcome.screen = HTTP/1.1[\r][\n]" [DEBUG] HttpMethodBase - Adding Host request header [DEBUG] header - >> "Accept: image/gif, image/x-xbitmap, image/jpeg, = image/pjpeg, application/x-shockwave-flash, */*[\r][\n]" [DEBUG] header - >> "Accept-Language: en-us[\r][\n]" [DEBUG] header - >> "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; = Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)[\r][\n]" [DEBUG] header - >> "Proxy-Connection: Keep-Alive[\r][\n]" [DEBUG] header - >> "Host: localhost:8080[\r][\n]" [DEBUG] header - >> "[\r][\n]" [DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]" [DEBUG] header - << "Set-Cookie: = JSESSIONID=3DE3EC131BD85879A0BAF747C2AF373DED; Path=3D/petstore[\r][\n]" [DEBUG] header - << "Content-Type: text/html;charset=3DUTF-8[\r][\n]" [DEBUG] header - << "Transfer-Encoding: chunked[\r][\n]" [DEBUG] header - << "Date: Thu, 16 Jun 2005 09:55:19 GMT[\r][\n]" [DEBUG] header - << "Server: Apache-Coyote/1.1[\r][\n]" The response is a form which has 2 forms, one for Signing in and another = for registering a New User. I submit the first form by clicking the "Sign In" button. [DEBUG] header - >> "POST /petstore/j_signon_check HTTP/1.1[\r][\n]" [DEBUG] HttpMethodBase - Adding Host request header [DEBUG] header - >> "Accept: image/gif, image/x-xbitmap, image/jpeg, = image/pjpeg, application/x-shockwave-flash, */*[\r][\n]" [DEBUG] header - >> "Referer: = http://localhost:8080/petstore/signon_welcome.screen[\r][\n]" [DEBUG] header - >> "Accept-Language: en-us[\r][\n]" [DEBUG] header - >> "Content-Type: = application/x-www-form-urlencoded[\r][\n]" [DEBUG] header - >> "Proxy-Connection: Keep-Alive[\r][\n]" [DEBUG] header - >> "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; = Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)[\r][\n]" [DEBUG] header - >> "Content-Length: 46[\r][\n]" [DEBUG] header - >> "Pragma: no-cache[\r][\n]" [DEBUG] header - >> "Cookie: = JSESSIONID=3DE3EC131BD85879A0BAF747C2AF373DED[\r][\n]" [DEBUG] header - >> "Host: localhost:8080[\r][\n]" [DEBUG] header - >> "[\r][\n]" [DEBUG] HttpMethodBase - Default charset used: ISO-8859-1 [DEBUG] HttpMethodBase - Default charset used: ISO-8859-1 [DEBUG] content - >> = "j_username=3Dj2ee&j_password=3Dj2ee&submit=3DSign%2BIn" [DEBUG] EntityEnclosingMethod - Request body sent [DEBUG] header - << "HTTP/1.1 302 Moved Temporarily[\r][\n]" [DEBUG] header - << "Location: = http://localhost:8080/petstore/signon_welcome.screen[\r][\n]" [DEBUG] header - << "Content-Length: 0[\r][\n]" [DEBUG] header - << "Date: Thu, 16 Jun 2005 09:55:38 GMT[\r][\n]" [DEBUG] header - << "Server: Apache-Coyote/1.1[\r][\n]" [DEBUG] HttpMethodDirector - Redirect required [DEBUG] header - >> "GET /petstore/signon_welcome.screen = HTTP/1.1[\r][\n]" [DEBUG] HttpMethodBase - Adding Host request header [DEBUG] header - >> "Accept: image/gif, image/x-xbitmap, image/jpeg, = image/pjpeg, application/x-shockwave-flash, */*[\r][\n]" [DEBUG] header - >> "Referer: = http://localhost:8080/petstore/signon_welcome.screen[\r][\n]" [DEBUG] header - >> "Accept-Language: en-us[\r][\n]" [DEBUG] header - >> "Proxy-Connection: Keep-Alive[\r][\n]" [DEBUG] header - >> "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; = Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)[\r][\n]" [DEBUG] header - >> "Pragma: no-cache[\r][\n]" [DEBUG] header - >> "Cookie: = JSESSIONID=3DE3EC131BD85879A0BAF747C2AF373DED[\r][\n]" [DEBUG] header - >> "Host: localhost:8080[\r][\n]" [DEBUG] header - >> "[\r][\n]" [DEBUG] header - << "HTTP/1.1 501 Method InGET is not defined in RFC = 2068 and is not supported by the Servlet API [\r][\n]" [DEBUG] header - << "Content-Type: text/html;charset=3Dutf-8[\r][\n]" [DEBUG] header - << "Content-Length: 1229[\r][\n]" [DEBUG] header - << "Date: Thu, 16 Jun 2005 09:55:38 GMT[\r][\n]" [DEBUG] header - << "Server: Apache-Coyote/1.1[\r][\n]" [DEBUG] header - << "Connection: close[\r][\n]" [DEBUG] content - << "Apache Tomcat/5.0.28 - Error = report

HTTP Status 501 - Method InGET is = not defined in RFC 2068 and is not supported by the Servlet API


type Status = report

message Method InGET is not defined in RFC 2068 = and is not supported by the Servlet API

description = The server does not support the functionality needed to fulfill this = request (Method InGET is not defined in RFC 2068 and is not supported by = the Servlet API ).


Apache = Tomcat/5.0.28

" [DEBUG] HttpMethodBase - Should close connection in response to = directive: close [DEBUG] HttpConnection - Releasing connection back to connection = manager. The expected behaviour is that the user logs in to the Store, But On = submitting this request, I get=20 "HTTP Status 501 - Method InGET is not defined in RFC 2068 and is not = supported by the Servlet API " Note the Method "InGet", The "In" is actually value of the last = parameter sent in the Post Method. [DEBUG] content - >> = "j_username=3Dj2ee&j_password=3Dj2ee&submit=3DSign%2BIn" I have checked this with some other Post method submits in the Petstore = demo itself, And I am getting end characters of the Post method's = request data. I am attaching the trace.log file with this mail. Note that I am = handling the Redirection in my code, hence I have set the redirection to = false. I have performed the "Things To Try", and this happens only when my code = sits between Browser and server. I have debugged the problem, And If I = create the MultiThreadedHttpConnectionManager every time I create an = object of HttpMethod and set it to HttpClient's reference, this problem = doesn't arise i.e. The response on submitting the form is proper one. I = know that MultiThreadedHttpConnectionManager should not be created every = time. Please let me know If I am doing something wrong or is this a bug in = HttpClient's code? I have also tried this with the nighty build. My code = is also based on the tutorial i.e. the sequence of API's being called = are in the same sequence. Eagerly waiting for your response. Regards, Amol Kulkarni. ------=_NextPart_001_0038_01C5728C.EC01DC60 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 Hi ,
 
I am using HttpClient as a Proxy = Recorder i.e. An=20 request made through Browser goes through my code and I am using = HttpClient to=20 fire the browser request. The response that I get from HttpMethod is = written=20 back to the Browser. I facing a problem (which I feel is a bug in=20 HttpClient).
 
To test my Proxy Recorder I have = configured the=20 PetStore demo.
 
Very briefly, The first URL that I fire = (or execute=20 using HttpClient) is
 
http://loca= lhost:8080/petstore/signon_welcome.screen
 
[DEBUG] header - >> "GET=20 /petstore/signon_welcome.screen HTTP/1.1[\r][\n]"
[DEBUG] = HttpMethodBase -=20 Adding Host request header
[DEBUG] header - >> "Accept: = image/gif,=20 image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, = */*[\r][\n]"
[DEBUG] header - >> "Accept-Language:=20 en-us[\r][\n]"
[DEBUG] header - >> "User-Agent: Mozilla/4.0=20 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR=20 1.1.4322)[\r][\n]"
[DEBUG] header - >> "Proxy-Connection:=20 Keep-Alive[\r][\n]"
[DEBUG] header - >> "Host:=20 localhost:8080[\r][\n]"
[DEBUG] header - >> = "[\r][\n]"
[DEBUG]=20 header - << "HTTP/1.1 200 OK[\r][\n]"
[DEBUG] header - << = "Set-Cookie: JSESSIONID=3DE3EC131BD85879A0BAF747C2AF373DED;=20 Path=3D/petstore[\r][\n]"
[DEBUG] header - << "Content-Type:=20 text/html;charset=3DUTF-8[\r][\n]"
[DEBUG] header - <<=20 "Transfer-Encoding: chunked[\r][\n]"
[DEBUG] header - << "Date: = Thu, 16=20 Jun 2005 09:55:19 GMT[\r][\n]"
[DEBUG] header - << "Server:=20 Apache-Coyote/1.1[\r][\n]"
The response is a form which has 2 = forms, one for=20 Signing in and another for registering a New User.
 
I submit the first form by clicking the "Sign In" button.
 
[DEBUG] header - >> "POST=20 /petstore/j_signon_check HTTP/1.1[\r][\n]"
[DEBUG] HttpMethodBase - = Adding=20 Host request header
[DEBUG] header - >> "Accept: image/gif,=20 image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, = */*[\r][\n]"
[DEBUG] header - >> "Referer: http= ://localhost:8080/petstore/signon_welcome.screen[\r][\n]"
[DEBUG] = header - >> "Accept-Language: en-us[\r][\n]"
[DEBUG] header - = >>=20 "Content-Type: application/x-www-form-urlencoded[\r][\n]"
[DEBUG] = header -=20 >> "Proxy-Connection: Keep-Alive[\r][\n]"
[DEBUG] header - = >>=20 "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR = 1.0.3705; .NET CLR 1.1.4322)[\r][\n]"
[DEBUG] header - >>=20 "Content-Length: 46[\r][\n]"
[DEBUG] header - >> "Pragma:=20 no-cache[\r][\n]"
[DEBUG] header - >> "Cookie:=20 JSESSIONID=3DE3EC131BD85879A0BAF747C2AF373DED[\r][\n]"
[DEBUG] header = -=20 >> "Host: localhost:8080[\r][\n]"
[DEBUG] header - >>=20 "[\r][\n]"
[DEBUG] HttpMethodBase - Default charset used:=20 ISO-8859-1
[DEBUG] HttpMethodBase - Default charset used:=20 ISO-8859-1
[DEBUG] content - >>=20 "j_username=3Dj2ee&j_password=3Dj2ee&submit=3DSign%2BIn
"
[DEBUG] EntityEnclosingMethod - = Request=20 body sent
[DEBUG] header - << "HTTP/1.1 302 Moved=20 Temporarily[\r][\n]"
[DEBUG] header - << "Location: http= ://localhost:8080/petstore/signon_welcome.screen[\r][\n]"
[DEBUG] = header - << "Content-Length: 0[\r][\n]"
[DEBUG] header - = <<=20 "Date: Thu, 16 Jun 2005 09:55:38 GMT[\r][\n]"
[DEBUG] header - = <<=20 "Server: Apache-Coyote/1.1[\r][\n]"
[DEBUG] HttpMethodDirector - = Redirect=20 required
[DEBUG] header - >> "GET = /petstore/signon_welcome.screen=20 HTTP/1.1[\r][\n]"
[DEBUG] HttpMethodBase - Adding Host request=20 header
[DEBUG] header - >> "Accept: image/gif, image/x-xbitmap, = image/jpeg, image/pjpeg, application/x-shockwave-flash, = */*[\r][\n]"
[DEBUG]=20 header - >> "Referer: http= ://localhost:8080/petstore/signon_welcome.screen[\r][\n]"
[DEBUG] = header - >> "Accept-Language: en-us[\r][\n]"
[DEBUG] header - = >>=20 "Proxy-Connection: Keep-Alive[\r][\n]"
[DEBUG] header - >> = "User-Agent:=20 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; = .NET CLR=20 1.1.4322)[\r][\n]"
[DEBUG] header - >> "Pragma:=20 no-cache[\r][\n]"
[DEBUG] header - >> "Cookie:=20 JSESSIONID=3DE3EC131BD85879A0BAF747C2AF373DED[\r][\n]"
[DEBUG] header = -=20 >> "Host: localhost:8080[\r][\n]"
[DEBUG] header - >>=20 "[\r][\n]"
[DEBUG] header - << "HTTP/1.1 501 Method InGET is = not=20 defined in RFC 2068 and is not supported by the Servlet API = [\r][\n]"
[DEBUG]=20 header - << "Content-Type: = text/html;charset=3Dutf-8[\r][\n]"
[DEBUG]=20 header - << "Content-Length: 1229[\r][\n]"
[DEBUG] header - = <<=20 "Date: Thu, 16 Jun 2005 09:55:38 GMT[\r][\n]"
[DEBUG] header - = <<=20 "Server: Apache-Coyote/1.1[\r][\n]"
[DEBUG] header - << = "Connection:=20 close[\r][\n]"
[DEBUG] content - <<=20 "<html><head><title>Apache Tomcat/5.0.28 - Error=20 report</title><style><!--H1=20 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76= ;font-size:22px;}=20 H2=20 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76= ;font-size:16px;}=20 H3=20 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76= ;font-size:14px;}=20 BODY = {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}= B=20 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76= ;} P=20 {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-si= ze:12px;}A=20 {color : black;}A.name {color : black;}HR {color : = #525D76;}--></style>=20 </head><body><h1>HTTP Status 501 - Method InGET is not = defined=20 in RFC 2068 and is not supported by the Servlet API </h1><HR = size=3D"1"=20 noshade=3D"noshade"><p><b>type</b> Status=20 report</p><p><b>message</b> <u>Method = InGET is not=20 defined in RFC 2068 and is not supported by the Servlet API=20 </u></p><p><b>description</b> <u>The = server=20 does not support the functionality needed to fulfill this request = (Method InGET=20 is not defined in RFC 2068 and is not supported by the Servlet API=20 ).</u></p><HR size=3D"1" = noshade=3D"noshade"><h3>Apache=20 Tomcat/5.0.28</h3></body></html>"
[DEBUG] = HttpMethodBase -=20 Should close connection in response to directive: close
[DEBUG]=20 HttpConnection - Releasing connection back to connection=20 manager.
 
 The expected behaviour is that = the user logs=20 in to the Store, But On submitting this request, I get =

"HTTP Status 501 - Method InGET is not defined in RFC 2068 and is = not=20 supported by the Servlet API "
 
Note the Method "InGet", The "In" is actually value of the last = parameter=20 sent in the Post Method.
 
[DEBUG] content - >>=20 "j_username=3Dj2ee&j_password=3Dj2ee&submit=3DSign%2BIn"
 
I have checked this with some other Post method submits in the = Petstore=20 demo itself, And I am getting end characters of the Post method's = request=20 data.
 
I am attaching the trace.log file with this mail. Note that I am = handling=20 the Redirection in my code, hence I have set the redirection to = false.
 
I have performed the "Things To Try", and this happens only when my = code=20 sits between Browser and server. I have = debugged the=20 problem, And If I create the MultiThreadedHttpConnectionManager every = time I=20 create an object of HttpMethod and set it to HttpClient's reference, = this=20 problem doesn't arise i.e. The response on submitting = the form=20 is proper one. I know that MultiThreadedHttpConnectionManager should not = be=20 created every time.
 
Please let me know If I am doing something wrong or is this a bug = in=20 HttpClient's code? I have also tried this with the nighty build. My code = is also=20 based on the tutorial i.e. the sequence of API's being called are in the = same=20 sequence.
 
 
Eagerly waiting for your response.
 
Regards,
Amol Kulkarni.
 
 
 
------=_NextPart_001_0038_01C5728C.EC01DC60-- ------=_NextPart_000_0037_01C5728C.EC01DC60 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-user-help@jakarta.apache.org ------=_NextPart_000_0037_01C5728C.EC01DC60--