Thread Dumps


RootCause Exception

During the development of JSPs and servlets, you may trigger exceptions in the code. At times the resulting output from the exception is what caused the error in the first place, because the server is overriding the original exception to provide some information. You really want to know the underlying cause of the error. The Resin server allows you to access this rootCause exception. Consider the following code:

 catch (Exception e) {   debug.log(Level.WARNING, e.toString(), e);   Throwable rootE = e.getCause();   if (rootE != null)     debug.log(Level.WARNING, e.toString(), e); } 

This code includes a normal try/catch block that catches all Exception types. The information about the exception will be logged to the Resin logging system.




Mastering Resin
Mastering Resin
ISBN: 0471431036
EAN: 2147483647
Year: 2002
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net