You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by lanchez <ap...@purpleblade.net> on 2008/01/18 19:34:59 UTC

How to trap exceptions (exception listener available in servlet or tomcat?)

	
All,

I have a web application and I want to create a generic exception
handler/listener which will listen to all the exceptions (checked and
runtime) which are thrown by web application.

During a debug sessions I want to enable this listener and bring Tomcat to a
screeching halt if there is an exception thrown so I need a listener for any
/ all exceptions.  I have a large code base that I inherited and an
exception is being thrown and buried somewhere so there is no stack trace
from the exception in any of the tomcat logs.

Any idea how can I do this? 

Regards. 
-- 
View this message in context: http://www.nabble.com/How-to-trap-exceptions-%28exception-listener-available-in-servlet-or-tomcat-%29-tp14955601p14955601.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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


Re: How to trap exceptions

Posted by david delbecq <de...@oma.be>.
lanchez a écrit :
> 	
> All,
>
> I have a web application and I want to create a generic exception
> handler/listener which will listen to all the exceptions (checked and
> runtime) which are thrown by web application.
>   
If they reach level of tomcat, just write a servlet filter, and manage 
it there (try { chain.doFiter(...) } (catch .....) {....}
> During a debug sessions I want to enable this listener and bring Tomcat to a
> screeching halt if there is an exception thrown so I need a listener for any
> / all exceptions.  I have a large code base that I inherited and an
> exception is being thrown and buried somewhere so there is no stack trace
> from the exception in any of the tomcat logs.
>
> Any idea how can I do this? 
>   
If you want to bring tomcat to a streching halt when an exception is 
thrown somewhere (whever or not it is catched), i suggest you run tomcat 
in eclipse debugger -> supend on exception... However! You will quickly 
notice it's not manageable unless you know which exception you want to 
look at. This is because in the normal exception of application tons of 
exception are thrown and catched as part of normal application execution.
> Regards. 
>   


---------------------------------------------------------------------
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