I committed this patch with svn 169501.
Sunitha Kambhampati wrote:
http://issues.apache.org/jira/browse/DERBY-237?page=all
This patch fixes derby-237: Boot errors from store must not lose error messages/stack traces in between.
Actually nested exceptions from the boot error were not lost but their stack traces were not being written out into error stream which is why the entire stack traces of exceptions was not printed out to derby.log
svn stat M java\engine\org\apache\derby\impl\store\raw\log\LogToFile.java
-- I tested it with a corrupted database (from derby 241) that resulted in boot error and the stack traces are printed out ok in derby.log.
-- I ran derbyall suite and all tests passed.
Please review it and if there are no comments, can a committer please commit it.
Thanks, Sunitha.
------------------------------------------------------------------------
Index: java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java
===================================================================
--- java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java (revision 168348)
+++ java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java (working copy)
@@ -3951,14 +3951,18 @@
}
}
+ /**
+ * print stack trace from the Throwable including
+ * its nested exceptions + * @param t trace starts from this error
+ */
private void printErrorStack(Throwable t)
{
- Monitor.logMessage("-------------------------\n");
- t.printStackTrace(Monitor.getStream().getPrintWriter());
- Monitor.logMessage("-------------------------\n");
ErrorStringBuilder esb = new ErrorStringBuilder(Monitor.getStream().getHeader());
esb.stackTrace(t);
- }
+ Monitor.logMessage(esb.get().toString());
+ esb.reset();
+ }
/**
