1 23 24 package com.sun.enterprise.util; 25 26 import java.io.StringWriter ; 27 import java.io.PrintWriter ; 28 29 34 public class JException { 35 41 public static String getStackTrace(Throwable obj) { 42 if (obj == null) 43 return null; 44 45 StringWriter traceBuf = new StringWriter (); 46 PrintWriter pw = new PrintWriter (traceBuf); 47 48 obj.printStackTrace(pw); 49 pw.close(); 50 51 return traceBuf.toString(); 52 } 53 } 54 | Popular Tags |