tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <>
Subject Re: 501 Method not implemented with successive POST requests
Date Fri, 13 Aug 2010 09:54:01 GMT
On 13/08/2010 10:07, Hans Wahn wrote:
> Hello Tomcat-Users,
> I'm facing a strange issue when using HttpComponents with successive
> POST requests against a simple Tomcat 7 servlet (Form-based POST
> Authentication is enabled). After a sucessfull authentication, the
> client requests the same protected resource a few times in a row, but
> the second request always returns a "501 Method not implemented"
> status. All other requests succeed.
> The following communication takes place:
> 1. Client requests a protected resource; Tomcat returns the login page (HTTP200)
> 2. Client provides the user credentials and calls the login resource;
> Tomcat returns a redirect (HTTP302)
> 3. Client sets the location from the redirect for the next
> request(identical to URI from #1) and requests it; Tomcat returns the
> page (HTTP200)
> 4. Client requests the same resource again; Tomcat returns a HTTP501 -
> Method not implemented
> 5. Client requests the same resource again; Tomcat returns the page (HTTP200)
> 6. Client requests the same resource again; Tomcat returns the page (HTTP200)
> 7. Client requests the same resource again; Tomcat returns the page (HTTP200)
> The access log message regarding the 501 says:
> '"testName=testValuePOST /test/secure/ HTTP/1.1" 501 1278', which may

What is the exact header & body of the 302 redirect from Tomcat in #2?

Given that the client performs steps 3 & 4, can you check what's being
*sent* by the client, not what's being received by Tomcat?

Are you sure the client isn't making that error?

What is the client code which makes the request here?


> indicate that the entity data and the HTTP-method name somehow got
> mixed up!? Strangely the HTTP501 does not appear in case of a JSP for
> the requested resource, only if facing a form-based POST
> authentication Servlet in Tomcat 7. The servlet does only implement
> post and get(which calls the doPost) and returns just a string. The
> client code should be fine since I already posted this issue on the
> HTTPComponents mailing list and the data sent over the wire seems to
> be right.
> I'd like to attach the zipped webapp dir along with the simple client
> souce code, but along with the HTTPComponents libraries it's ~450KB
> and I don't know the attachment policy of this list. How can I provide
> further helpfull information?
> Thanks for helping in advance
> best regards
> Hans
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message