tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kirchhoff, Florian" <Florian.Kirchh...@qwest.com>
Subject RE: Custom Error Messages (5xx and 4xx)
Date Mon, 10 Nov 2008 17:31:58 GMT
Rob,

I feel for you, I experienced the frustrations of the "zero size
response/blank page" several times, each times with a different root
cause.

I have used several approaches in the past:
1) first make sure the 500 page itself isn't causing the problem. Use a
plain JSP instead to see if you still get a blank response.
2) do you have any servlet filter? Make sure to exclude your error pages
from being processed by the filters.
4) Increase logging levels for TOMCAT to DEBUG, but be prepared, it
generate a LOT of output.
3) As last attach a debugger to the tomcat process and break on any
Exception thrown. This can be time consuming since a lot of Exception
can be thrown even during normal execution... 

Sorry if this is so generic... I hope you find a solution to your
problem.

Florian
> -----Original Message-----
> From: Rob Mercer [mailto:r.mercer@magnushealth.com]
> Sent: Tuesday, November 04, 2008 2:13 PM
> To: Tomcat Users List
> Subject: RE: Custom Error Messages (5xx and 4xx)
> 
> Correction, the 404 error pages now seem to work, but the
> 500 error page
> is not being produced on an error
> 
> -Rob
> 
> -----Original Message-----
> From: Rob Mercer [mailto:r.mercer@magnushealth.com]
> Sent: Tuesday, November 04, 2008 2:09 PM
> To: Tomcat Users List
> Subject: RE: Custom Error Messages (5xx and 4xx)
> 
> First off, thank you for your responses, I've worked on
> this a little
> more and am still have problems getting the error message
> pages to even
> appear when the server side error is generated. Below is my
> web.xml
> 
> 
> 	<!-- Use Documents saved as *.xhtml for Facelets-->
> 	<context-param>
> 		<param-name>javax.faces.DEFAULT_SUFFIX</param-
> name>
> 		<param-value>.xhtml</param-value>
> 	</context-param>
> 
> 	<context-param>
>   		<param-name>facelets.VIEW_MAPPINGS</param-name>
>   		<param-value>*.xhtml</param-value>
> 	</context-param>
> ....
> 
> <!-- Error configuration  -->
> 	<error-page>
> 		<error-code>404</error-code>
> 		<location>/error_pages/404.xhtml</location>
> 	</error-page>
> 
> 	<error-page>
> 		<error-code>500</error-code>
> 		<location>/error_pages/500.xhtml</location>
> 	</error-page>
> 
> Please let me know if I missed anything relevant.
> 
> Currently when an error (500) is generated all I get is a
> blank white
> screen :(. I can go directly to the error pages both logged
> into the
> system and not and I get the nice little "Something has
> gone wrong .."
> custom error page that I've setup for this test...
> 
> Any ideas?
> 
> -Rob
> 
> -----Original Message-----
> From: Kirchhoff, Florian
> [mailto:Florian.Kirchhoff@qwest.com]
> Sent: Tuesday, November 04, 2008 10:20 AM
> To: Tomcat Users List
> Subject: RE: Custom Error Messages (5xx and 4xx)
> 
> Rob,
> 
> First you need to gather the information about the
> exception, then send
> it to who needs to know. You might want to be proactive and
> send it to
> the support team regardless of what the users want...
> 
> One thing to lookout for is that depending on where you
> exception is
> thrown the implicit "exception" variable may not be the one
> you're
> looking for and you have to "unwind" the calling stack to
> find the root
> cause. That's what Tomcat's default error page does. I
> found it
> instructive to study the source of the ErrorReportValve in
> subversion:
> <http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/
> org/apache/ca
> talina/valves/ErrorReportValve.java>
> 
> Look into the "report" method to see how to use
> "exception.getCause()"
> to get to the root cause.
> 
> I hope you find this useful.
> 
> Florian
> 
> 
> > -----Original Message-----
> > From: Serge Fonville [mailto:serge.fonville@gmail.com]
> > Sent: Monday, November 03, 2008 4:44 PM
> > To: Tomcat Users List
> > Subject: Re: Custom Error Messages (5xx and 4xx)
> >
> > Hi,
> >
> > Look at
> >
> http://java.sun.com/developer/EJTechTips/2003/tt0114.html,
> > especially the text
> > The string isErrorPage="true" causes the Web container to
> > define a new
> > implicit variable, "exception", that the JSP page can use
> > in scriptlets or
> > in custom tags. For example, the error page for the
> current
> > example uses the
> > "exception" object to report the name of the class that
> > caused the
> > exception:
> > Basically when at the top of the jsp you specify
> > isErrorPage=true, you have
> > a variable exception that contains the thrown exception
> >
> > Hope this helps
> >
> > Regards,
> >
> > Serge Fonville
> > On Mon, Nov 3, 2008 at 10:31 PM, Rob Mercer
> > <r.mercer@magnushealth.com>wrote:
> >
> > > Hey all,
> > >
> > >                I'm trying to setup custom error
> messages
> > in Tomcat
> > > 6.0.14. I've got the following entry in web.xml:
> > >
> > >
> > >
> > > <!-- Error configuration  -->
> > >
> > >      <error-page>
> > >
> > >            <error-code>404</error-code>
> > >
> > >            <location>/error_pages/404.jsf</location>
> > >
> > >      </error-page>
> > >
> > >
> > >
> > >      <error-page>
> > >
> > >            <error-code>500</error-code>
> > >
> > >            <location>/error_pages/500.jsf</location>
> > >
> > >      </error-page>
> > >
> > > ....
> > >
> > >
> > >
> > > And I've got a much less scary set of pages setup but I
> > was wondering if
> > > there was a way to get the stack trace and error
> message
> > information to
> > > shoot to the support team if the user clicked an "email
> > the support team
> > > about this error message."  Any ideas on how I'd go
> about
> > that?
> > >
> > >
> > >
> > > Additionally, is there a way to setup a 5xx page? Just
> a
> > page that
> > > handled all 500 pages? Like a web.xml shorthand?
> > >
> > >
> > >
> > >
> > >
> > > Thanks ahead of time!
> > >
> > >
> > >
> > > Rob M
> > >
> > >
> 
> 
> This communication is the property of Qwest and may contain
> confidential
> or
> privileged information. Unauthorized use of this
> communication is
> strictly
> prohibited and may be unlawful.  If you have received this
> communication
> 
> in error, please immediately notify the sender by reply e-
> mail and
> destroy
> all copies of the communication and any attachments.
> 
> -----------------------------------------------------------
> ----------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-
> help@tomcat.apache.org
> 
> 
> -----------------------------------------------------------
> ----------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-
> help@tomcat.apache.org
> 
> 
> -----------------------------------------------------------
> ----------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-
> help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message