>>62
Exception e = new Exception();
StringWriter s = new StringWriter();
PrintWriter w = new PrintWriter( s );
e.printStackTrace( w );
w.flush();

String str = s.toString();