You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/06/03 17:44:46 UTC

DO NOT REPLY [Bug 51316] New: Tomcat does not redirect to configured http 500 error-page

https://issues.apache.org/bugzilla/show_bug.cgi?id=51316

             Bug #: 51316
           Summary: Tomcat does not redirect to configured http 500
                    error-page
           Product: Tomcat 5
           Version: 5.5.27
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Unknown
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: kclaver@yahoo.com
    Classification: Unclassified


Hi, I've seen several posts related to this bug, but most if not all are marked
resolved or invalid.  Unfortunately, I am still seeing the issue.  I've been
able to narrow it down to tomcat on Linux.

Issue: Tomcat does not redirect to the HMAExceptionHandlerServlet servlet I
have configured in the application specific web.xml when running on Linux

I've tried searching all of the lists for an answer to this question.  I've
seen several postings by people having the same issue, but never a solution.

My Tomcat version:

Apache Tomcat 5.5.27 (I've also tried 5.5.33 and 6.0.32)

running on:

Fedora 2.6.27.5-117.fc10.x86_64

with JDK version:

1.6.0_25

A few things I would like to note:

1.  This is a vanilla Tomcat 5.5.27 install.

2.  When I copy the web application directly from the Linux Tomcat install to a
Vanilla Tomcat install on Windows 7, the 500 redirect to my custom error
servlet works.

3.  When I invoke the Java HMAExceptionHandlerServlet configured to be used in
the error-page block in the application specific web.xml directly from the URL
in the browser, it works.  It also works if I invoke it using the
/error/ExceptionHandler servlet mapping url pattern.

4.  If I change the error code to be 404, Tomcat correctly redirects to the
custom error page.

5.  Tomcat 5.5.33 does correctly redirect to the error-page when running on a
Windows 7 machine.  The only time I have an issue is on the Linux configuration
above.

6.  I see the error code logged in the access log.

192.168.xxx.xxx - - [02/Jun/2011:13:53:14 -0600] "POST
/HMAApp/faces/main/TaskSearchTab.jsp HTTP/1.0" 500 1000

7.  I see both the com.sun.rave.web.ui.appbase.ApplicationException and the
java.lang.NullPointerException in the localhost log (both are configured in the
application specific web.xml to redirect to the custom error servlet.

Jun 2, 2011 1:53:14 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
com.sun.rave.web.ui.appbase.ApplicationException
        at
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.cleanup(ViewHandlerImpl.java:559)
        at
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:276)
        at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at
com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:198)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:581)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
        at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
        at hmaapp.utilmanagement.OPProcMain.prerender(OPProcMain.java:2355)
        at
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.prerender(ViewHandlerImpl.java:771)
        at
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:268)
        ... 22 more

My application specific web.xml (located in <tomcat \
install>/webapps/<application>/WEB-INF folder) :

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" \
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee \
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">     <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
       
<param-value>/WEB-INF/navigation.xml,/WEB-INF/managed-beans.xml</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>false</param-value>
    </context-param>
    <filter>
        <filter-name>UploadFilter</filter-name>
        <filter-class>com.sun.rave.web.ui.util.UploadFilter</filter-class>
        <init-param>
            <description>
          The maximum allowed upload size in bytes.  If this is set
          to a negative value, there is no maximum.  The default
          value is 1000000.
            </description>
            <param-name>maxSize</param-name>
            <param-value>1000000</param-value>
        </init-param>
        <init-param>
            <description>
          The size (in bytes) of an uploaded file which, if it is
          exceeded, will cause the file to be written directly to
          disk instead of stored in memory.  Files smaller than or
          equal to this size will be stored in memory.  The default
          value is 4096.
            </description>
            <param-name>sizeThreshold</param-name>
            <param-value>4096</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>UploadFilter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>ThemeServlet</servlet-name>
        <servlet-class>com.sun.rave.web.ui.theme.ThemeServlet</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>HMAExceptionHandlerServlet</servlet-name>
        <servlet-class>hmaapp.common.HMAExceptionHandlerServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>HMAExceptionHandlerServlet</servlet-name>
        <url-pattern>/error/ExceptionHandler</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>ThemeServlet</servlet-name>
        <url-pattern>/theme/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>InterqualJSServlet</servlet-name>
        <url-pattern>/InterqualJSServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>HMAExceptionHandlerServlet</servlet-name>
        <url-pattern>/HMAExceptionHandlerServlet</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>faces/SignOn.jsp</welcome-file>
    </welcome-file-list>
    <error-page>
        <exception-type>javax.servlet.ServletException</exception-type>
        <location>/error/ExceptionHandler</location>
    </error-page>
    <error-page>
        <exception-type>java.io.IOException</exception-type>
        <location>/error/ExceptionHandler</location>
    </error-page>
    <error-page>
        <exception-type>javax.faces.FacesException</exception-type>
        <location>/error/ExceptionHandler</location>
    </error-page>
    <error-page>
       
<exception-type>com.sun.rave.web.ui.appbase.ApplicationException</exception-ty
\
pe>         <location>/error/ExceptionHandler</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/error/ExceptionHandler</location>
    </error-page>
    <error-page>
        <exception-type>java.lang.NullPointerException</exception-type>
        <location>/error/ExceptionHandler</location>
    </error-page>
    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jspf</url-pattern>
            <is-xml>true</is-xml>
        </jsp-property-group>
    </jsp-config>
</web-app>

Thanks!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51316] Tomcat does not redirect to configured http 500 error-page

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51316

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME

--- Comment #1 from Mark Thomas <ma...@apache.org> 2011-06-03 21:03:12 UTC ---
This works for me, on linux, with the latest 5.5.x.

Before re-opening this issue, you'll need to provide the simplest possible test
case that reproduces it on a clean 5.5.x install using the latest 5.5.x
version. Based on the description, just two servlets and a web.xml should be
all that are required.

Right now, this looks like an issue in the framework you are using rather than
a Tomcat issue.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org