Little warning for anyone else who stumbles across this problem: the stylesheet used for <junitreport> in Ant 1.6.2 does not work with Xalan 2.2. Unfortunately, this is the version that’s bundled inside the rt.jar in Java 1.4.1.
The symptom is that it complains about a ClassNotFoundException for ‘redirect’. The solution is to upgrade to using Xalan 2.6. Unfortunately, that’s not as easy as it could be.
Fortunately, the Xalan guys have come across this before and very nicely have given instructions on how to overcome it.
This is not a problem for Java 1.4.2, BTW.
—-
Updated: The Ant Bugzilla ID for this is 30200
—-
Updated again: This is what the error looks like:
[junitreport] jar:file:/D:/work/3rdparty/apache/ant/lib/ant-junit.jar! /org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl; Line 41; Column 53; javax.xml.transform.TransformerException: java.lang.ClassNotFoundException: redirect [junitreport] jar:file:/D:/work/3rdparty/apache/ant/lib/ant-junit.jar! /org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl; Line 46; Column 57; javax.xml.transform.TransformerException: java.lang.ClassNotFoundException: redirect [junitreport] jar:file:/D:/work/3rdparty/apache/ant/lib/ant-junit.jar! /org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl; Line 51; Column 64; javax.xml.transform.TransformerException: java.lang.ClassNotFoundException: redirect [junitreport] jar:file:/D:/work/3rdparty/apache/ant/lib/ant-junit.jar! /org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl; Line 56; Column 62; javax.xml.transform.TransformerException: java.lang.ClassNotFoundException: redirect [junitreport] jar:file:/D:/work/3rdparty/apache/ant/lib/ant-junit.jar! /org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl; Line 61; Column 64; javax.xml.transform.TransformerException: java.lang.ClassNotFoundException: redirect
And so on and so forth….
problem exists also in java 1.4.02.
upgrading to java 1.5 solved the problem.
I had this problem in j2sdk1.4.1_01, Xalan 2.6.0 . Read the item at http://xml.apache.org/xalan-j/faq.html#faq-N100CC. I did not find an “endorsed” folder in the jdk installation so created an “endorsed” folder in j2sdk1.4.1_01lib and copied Xalan.jar to it. Didn’t work.
Later found that the endorsed folder should be created in j2sdk1.4.1_01jrelib and this is what the Xalan faq refers to as . When the Xalan.jar was copied to j2sdk1.4.1_01jrelibendorsed and the ant script was run the problem went away. Hope this helps someone. However I am going to install jdk 1.4.2 or higher and do the work.
I’ve met exactly the same problem, but found that a couple of the links above didn’t help me. I’ve written up my experience here: http://www.duncanjauncey.com/blog/?p=41