例外を起こさずにStackTraceを取得するには

java1.5以上から可能となった。


・該当のスレッドのスタックトレースのみ取得
Thread.currentThread().getStackTrace();


・現在稼動している全てのスレッドのスタックトレースを取得
Thread.getAllStackTraces();



スタックトレースの取得
http://www.techscore.com/tech/J2SE/Thread/6.html#thr6-2