FileDocCategorySizeDatePackage
JException.javaAPI DocGlassfish v2 API2758Fri May 04 22:32:08 BST 2007com.sun.enterprise.util

JException

public class JException extends Object
Utility class that is used for getting the stack trace for an exception via a JNI upcall (used by the C++ JException class in src/cpp/iws/netsite/j2ee/NSJavaUtil.*).

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.StringgetStackTrace(java.lang.Throwable obj)
Collect the stack trace from the exception for use by native methods

param
obj Throwable object
return
string, representing the stack trace

        if (obj == null)
            return null;

        StringWriter traceBuf = new StringWriter();
        PrintWriter pw = new PrintWriter(traceBuf);
        
        obj.printStackTrace(pw);
        pw.close();
        
        return traceBuf.toString();