[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-2598) Exception handling - Never log and handle an exception, do one or the other

Christian Bauer (JIRA) jira-events at lists.jboss.org
Tue Feb 19 04:37:26 EST 2008


    [ http://jira.jboss.com/jira/browse/JBSEAM-2598?page=comments#action_12399818 ] 
            
Christian Bauer commented on JBSEAM-2598:
-----------------------------------------

With the patch proposed earlier, I tested the following scenarios with no exception handling defined in pages.xml and INFO logging for everything:

GET request, exception in page parameter setter
-------------------------------------------------------------

WARN  [org.jboss.seam.jsf.SeamPhaseListener] uncaught exception, passing to exception handler [full stack trace]
ERROR [org.jboss.seam.jsf.SeamPhaseListener] swallowing exception [repeated stack trace]
WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: null
ERROR [org.hibernate.util.JDBCExceptionReporter] Transaction is not active [just the message]
ERROR [org.jboss.seam.jsf.SeamPhaseListener] swallowing exception [the usual ELException because rendering failed, no transaction]
etc.

The response sent to the browser is a plain 404. I could get rid of the first WARN by changing the log level and the other logging + further exceptions by defining an exception handler. So that is OK now.


GET request, exception in page action
-------------------------------------------------------------

ERROR [org.jboss.seam.jsf.SeamPhaseListener] swallowing exception [full stacktrace]

The response sent to the browser is again a plain 404. This is basically the same message in the log as the second message from above, but we don't log a WARN before, saying that we will try the exception handler.  This time no transaction/persistence exception problems and I could get rid of the issue completely by defining an exception handler.

GET request, exception during rendering in value binding getter
-------------------------------------------------------------

ERROR [STDERR] Feb 19, 2008 10:32:12 AM com.sun.facelets.FaceletViewHandler handleRenderException [stacktrace of ELException]
ERROR [STDERR] tions.invoke(Reflections.java:21) [obscure stacktrace and THIS IS ALWAYS RANDOMLY CUT OFF, WHY?!]
WARN  [javax.enterprise.resource.webcontainer.jsf.lifecycle] executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl at 64a989) threw exception [same stacktrace as first message]
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/wiki].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception [just the root cause stacktrace]
WARN  [org.jboss.seam.web.ExceptionFilter] handling uncaught exception [again the full stacktrace]
WARN  [org.jboss.seam.web.ExceptionFilter] exception root cause [and again the full stacktrace]
WARN  [org.jboss.seam.web.ExceptionFilter] running exception handlers
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/wiki].[default]] Servlet.service() for servlet default threw exception [just the root cause stacktrace]

The response sent to the browser is again a 500 page with the full stack trace, drilled down to the (correct) root cause. Now, I could get rid of some WARN logging by changing my logging level but there is so much obscure logging going on there... this is really the case we need to fix.

I will do POST exception handling later.








> Exception handling - Never log and handle an exception, do one or the other
> ---------------------------------------------------------------------------
>
>                 Key: JBSEAM-2598
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2598
>             Project: JBoss Seam
>          Issue Type: Feature Request
>          Components: Core
>            Reporter: Shane Bryzak
>             Fix For: 2.1.0.GA
>
>
> Either I see my exception in the log (because it is one of the VERY
> RARE silently recoverable exceptions - I would not know a single one)
> or it is handled by my exception handler. Actually, I should never see
> an exception in my log unless I say so in my exception handler. I've
> seen Shane doing some commits about this but he only made logging
> configurable in Exceptions.handle(), which runs AFTER
> SeamPhaseListener already dumps a log.error("Uncaught exception", e).
> So basically, you can now configure if you want an exception logged
> twice or just once. This is btw killing me in production because my
> log fills up with login-password failures if someone makes a typo.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list