Oliver Jowett <oliver 'at' opencloud.com> writes:
> Stéphane RIFF wrote:
>
> > 2005-03-01 12:23:44,156 : [WARN] SQLoader - java.lang.NullPointerException
>
> Can you get a stack trace for this exception? (the NPE, not the earlier one)
Stephan - in case, here's a method to get a human readable
stacktrace given an Exception object, if you don't use java 1.5:
public static String backtrace( Exception e ) {
StackTraceElement[] trace = e.getStackTrace();
StringBuffer sb = new StringBuffer();
for ( int i = 2; i < trace.length; i++ ) {
sb.append( "\t" ).append( trace[i].toString() ).append( "\n" );
}
return sb.toString();
}
--
Guillaume Cottenceau