Re: 501 error not going to location
> > 1. How to you send your error and how do you test it? > I'm testing the error with simple HTTP clients that send requests using HTTP methods that the container and my app don't support by default (e.g. COPY, PROPFIND). While debugging my app, it's clear that the HTTP method and request are being sent correctly, and it seems that the Tomcat container's HttpServlet implementation handles sending the 501 error. 2. You may try debugging, w3ith a breakpoint in o.a.catalina.core. Thanks, I may try that. > 3. What is your error page? A servlet, a static file, a JSP? >> > It is a servlet, but I've also tested using a static HTML file, which doesn't work either. 4. 501 is "invalid method". I wonder whether it tries to serve the error > page itself using the same "wrong" method. E.g. the DefaultServlet > processes only valid methods (GET, POST, HEAD, ...). I think this may be what's happening. When the container HTTPServlet receives the request for the error-page it's still using the original method and so it's unable to serve up the error-page (again). I'll try to do some more debugging of Tomcat's code to understand what's happening, but in the meantime, I'd appreciate any other thoughts or ideas as to how custom 501 error pages may be handled. Thanks! On Wed, Mar 20, 2013 at 3:01 PM, Konstantin Kolinko wrote: > 2013/3/20 Shelley : > > I've configured an error-page in my web.xml to handle 501 error-codes, > but > > the resource specified in the location entry is not being returned by the > > container as expected. > > > > Here is the content of my web deployment descriptor. Note that the 404 > > error-page works as expected, but the 501 error-page does not. > > > > http://java.sun.com/xml/ns/javaee"; xmlns:xsi=" > > http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation=" > > java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> > > > > > > 404 > > /404 > > > > > > 501 > > /501 > > > > > > > > > > Without an error-page element for the 501, the default Tomcat HTML error > > page is returned with a status code of 501. When I add the error-page > > element, the response status code is 501 but no content is returned > > (Content-Length: 0). Instead, I would expect the content of my "/501" > > location to be returned. (This is the exact problem that was described in > > this thread [1] a couple years ago, but this thread did not seem to have > an > > answer/conclusion.) > > > > This is occurring on Apache Tomcat 7.0.37. > > > > Is there some additional configuration or modification needed for Tomcat > to > > honor the error-page location, or is this a bug? > > > > [1] > > > http://mail-archives.apache.org/mod_mbox/tomcat-users/201109.mbox/%3c32475425.p...@talk.nabble.com%3E > > 1. How to you send your error and how do you test it? > > 2. You may try debugging, w3ith a breakpoint in > o.a.catalina.core.StandardHostValve.status(..) > http://wiki.apache.org/tomcat/FAQ/Developing#Debugging > > 3. What is your error page? A servlet, a static file, a JSP? > > 4. 501 is "invalid method". I wonder whether it tries to serve the > error page itself using the same "wrong" method. E.g. the > DefaultServlet processes only valid methods (GET, POST, HEAD, ...). > > Best regards, > Konstantin Kolinko > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: 501 error not going to location
2013/3/20 Shelley : > I've configured an error-page in my web.xml to handle 501 error-codes, but > the resource specified in the location entry is not being returned by the > container as expected. > > Here is the content of my web deployment descriptor. Note that the 404 > error-page works as expected, but the 501 error-page does not. > > http://java.sun.com/xml/ns/javaee"; xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation=" > java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> > > > 404 > /404 > > > 501 > /501 > > > > > Without an error-page element for the 501, the default Tomcat HTML error > page is returned with a status code of 501. When I add the error-page > element, the response status code is 501 but no content is returned > (Content-Length: 0). Instead, I would expect the content of my "/501" > location to be returned. (This is the exact problem that was described in > this thread [1] a couple years ago, but this thread did not seem to have an > answer/conclusion.) > > This is occurring on Apache Tomcat 7.0.37. > > Is there some additional configuration or modification needed for Tomcat to > honor the error-page location, or is this a bug? > > [1] > http://mail-archives.apache.org/mod_mbox/tomcat-users/201109.mbox/%3c32475425.p...@talk.nabble.com%3E 1. How to you send your error and how do you test it? 2. You may try debugging, w3ith a breakpoint in o.a.catalina.core.StandardHostValve.status(..) http://wiki.apache.org/tomcat/FAQ/Developing#Debugging 3. What is your error page? A servlet, a static file, a JSP? 4. 501 is "invalid method". I wonder whether it tries to serve the error page itself using the same "wrong" method. E.g. the DefaultServlet processes only valid methods (GET, POST, HEAD, ...). Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: 501 error not going to location
Thank you for your reply, The is configured in a web.xml inside my webapp. As for the tomcat version it is Tomcat 7.0.21. Before adding the inside my webapp i was seeing - HTTP Status 501 - Method METHOD is not is not implemented by this servlet for this URI type Status reportmessage Method METHOD is not is not implemented by this servlet for this URI description The server does not support the functionality needed to fulfill this request (Method METHOD is not is not implemented by this servlet for this URI ).Apache Tomcat/7.0.21 After adding the inside my webapp i am see nothing. n828cl wrote: > >> From: kkrikor [mailto:krikor.kruml...@gmail.com] >> Subject: 501 error not going to location > >> I have set up an error page for the 501 error code. > > Where did you configure the ? (Be precise.) > >> Testing with Tomcat 7. > > Tomcat 7.what.what? (Be precise.) > > Since error pages are specific to individual webapps, Tomcat cannot honor > such configuration if the request is so malformed that it's impossible to > select a webapp to which to give the request. > > - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > MATERIAL and is thus for use only by the intended recipient. If you > received this in error, please contact the sender and delete the e-mail > and its attachments from all computers. > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > > -- View this message in context: http://old.nabble.com/501-error-not-going-to-location-tp32466722p32475425.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: 501 error not going to location
> From: kkrikor [mailto:krikor.kruml...@gmail.com] > Subject: 501 error not going to location > I have set up an error page for the 501 error code. Where did you configure the ? (Be precise.) > Testing with Tomcat 7. Tomcat 7.what.what? (Be precise.) Since error pages are specific to individual webapps, Tomcat cannot honor such configuration if the request is so malformed that it's impossible to select a webapp to which to give the request. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
501 error not going to location
Hey guys, I have set up an error page for the 501 error code. But it seems that it is not going to the error.html page when a 501 happens. Testing with Tomcat 7. 501 /error.html Here's how i'm testing - $ telnet localhost 8080 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. METHOD /lab-0.1.0.BUILD-SNAPSHOT/signup HTTP/1.1 Host: localhost HTTP/1.1 501 Not Implemented Server: Apache-Coyote/1.1 Transfer-Encoding: chunked Date: Wed, 14 Sep 2011 18:59:52 GMT Connection: close 0 Connection closed by foreign host. So i see 0 instead of the html content of error.html - Any ideas ? Thank you -- View this message in context: http://old.nabble.com/501-error-not-going-to-location-tp32466722p32466722.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org