How Tomcat handles 500 Error ?


Web tier: servlets, JSP, Web frameworks: How Tomcat handles 500 Error ?

  1. How Tomcat handles 500 Error ? (2 messages)

    I have apache1.3.27 and Tomcat 3.3-m4 installed on my Win2000 server. I have an application deployed and everything works fine except one thing:

    If I try a URL which doesn't exist, it return me error code 500 and an internal servlet error instead of my default jsp page.

    My web.xml looks like:
    I can see Tomcat backend console export the following message:
    page not found: /content/issue1.jsp
    Seems to me Tomcat do catch the 500 error but unable to redirect to my error jsp page.

    Is there anything else I should look at ?


    Threaded Messages (2)

  2. How Tomcat handles 500 Error ?[ Go to top ]

    Are you sure it is tomcat that is generating the Internal server error and not apache? I find that, depending on the connector and the configuration I amd using, 500 Errors are often generated by Apache when it can't redirect to the tomcat resource correctly
  3. How Tomcat handles 500 Error ?[ Go to top ]

    Thanks for reply.

    Yes,the error message was came from Tomcat, not Apache.
    I also put following code in web.xml trying to catch the servlet error. But seems doesn't work.

    Error: 500
    Location: =/demo/issue1
    Internal Servlet Error:

    at com.gdocomau.j2ee.web.controller.TemplateControllerServlet.processRequest(
    at com.gdocomau.j2ee.web.controller.TemplateControllerServlet.doGet(
    at javax.servlet.http.HttpServlet.service(
    at javax.servlet.http.HttpServlet.service(
    at org.apache.tomcat.facade.ServletHandler.doService(
    at org.apache.tomcat.core.Handler.service(
    at org.apache.tomcat.facade.ServletHandler.service(
    at org.apache.tomcat.core.ContextManager.internalService(
    at org.apache.tomcat.core.ContextManager.service(
    at org.apache.ajp.tomcat33.Ajp13Interceptor.processConnection(
    at org.apache.tomcat.util.threads.ThreadPool$