com.sun.enterprise.util
Class ExceptionUtil

java.lang.Object
  extended by com.sun.enterprise.util.ExceptionUtil

public final class ExceptionUtil
extends java.lang.Object

Useful utilities for Exceptions Subset of methods copied from org.glassfish.admin.amx.util


Method Summary
static java.lang.Throwable[] getCauses(java.lang.Throwable start)
          Get the chain of exceptions via getCause().
static java.lang.Throwable getRootCause(java.lang.Throwable e)
          Get the original troublemaker.
static java.lang.String getStackTrace(java.lang.Throwable t)
          Get the stack trace as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCauses

public static java.lang.Throwable[] getCauses(java.lang.Throwable start)
Get the chain of exceptions via getCause(). The first element is the Exception passed.

Parameters:
start - the Exception to traverse
Returns:
a Throwable[] or an Exception[] as appropriate

getRootCause

public static java.lang.Throwable getRootCause(java.lang.Throwable e)
Get the original troublemaker.

Parameters:
e - the Exception to dig into
Returns:
the original Throwable that started the problem

getStackTrace

public static java.lang.String getStackTrace(java.lang.Throwable t)
Get the stack trace as a String.

Parameters:
t - the Throwabe whose stack trace should be gotten
Returns:
a String containing the stack trace


Copyright © 2012 GlassFish Community. All Rights Reserved.