ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36733] - NPE in XMLJUnitResultFormatter.formatOutput under Java 1.4.2_08
Date Wed, 16 Nov 2005 18:43:01 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36733>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36733





------- Additional Comments From ats37@hotmail.com  2005-11-16 19:42 -------
I get exactly the same stack trace (for every test) from one of our projects
with Ant 1.6.5 running (as a forked external Ant instance) under CruiseControl.
 Another project runs (and generates the unit test HTML reports) successfully,
and I think the difference is in the libraries they have in their build/test
classpaths - the one that works includes xml-apis, xercesImpl and xalan jars in
its javac classpath, while the one that doesn't work only has xml-apis.

I think I may have some idea what's behind the error in the stack trace.  If
there's a problem occurring in XMLJUnitResultFormatter.getDocumentBuilder(), due
perhaps to classloader issues between the JDK's copy of xerces and another in
Ant's lib directory and/or the junit task's classpath, that might cause a
java.lang.ExceptionInInitializerError to be thrown when it's called from
startTestSuite(), which would exit prematurely leaving doc uninitialised. 
Winding back up the call stack, that means that the Error happens at the
fireStartTestSuite() call in JUnitTestRunner (line 287), but the finally clause
at line 304 will still try to call sendOutAndErr(String, String) at line 319,
which calls XMLJUnitResultFormatter.setSystemOutput, which calls
XMLJUnitResultFormatter.formatOutput, which throws a NPE when it tries to
execute doc.createElement(...) :-(
So the real error message (nested in the ExceptionInInitializerError) is lost
because we only get to see the NPE that's thrown subsequently...

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message