You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Na...@mail.sprint.com on 2002/12/13 15:49:29 UTC

RE: Junitreport -- where is org.apache.xalan.xslt.extensions.Redirect?

Hello All,


I am trying top get junitreport to work in Ant 1.5.1, but I am getting
ClassNotFound exceptions for the 
org.apache.xalan.xslt.extensions.Redirect
class.  I have Xalan-J 2.4.1 downloaded and the xalan.jar, xml-apis.jar,
xercesImpl.jar, and xmlParserAPIs.jar are all in my classpath when 
I run the task, but it still fails.  Furthermore, I have looked through
all the jar files that come with the xalan 2.4.1 distro (BCEL, bsf, 
etc..)
and can not find a reference to this class.  

The error I am getting is this:

[junitreport] 
jar:file:/C:/jakarta/ant/ant-1.5.1/jakarta-ant-1.5.1/lib/optional.
jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl; 
Line 134
; Column 74; javax.xml.transform.TransformerException: 
java.lang.ClassNotFoundEx
ception: org.apache.xalan.xslt.extensions.Redirect

My task looks like this:


        <!-- Run the junit reporter -->
        <target name="report" depends="init, build, junit">

                <mkdir dir="${deploy.dir}/${context.name}/test-results" 
/>
                <junitreport todir="${test.results}">
                        <fileset dir="${test.results}">
                                <include name="TEST-*.xml"/>
                        </fileset>

                        <report 
todir="${deploy.dir}/${context.name}/test-result
s" format="frames" />
                </junitreport>
        </target>


The Ant and Xalan distros are all the precompiled ones -- I did 
not build them on my machine.  Would this make a difference?  
Does the optional.jar that ships with 1.5.1 assume a different set
of xml libraries?  Anyone know how to get rid of this error?

Any help would be appreciated.

TIA, 

Nathan Cuka
nathan.s.cuka@mail.sprint.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Junitreport -- where is org.apache.xalan.xslt.extensions.Redirect?

Posted by Scott Stirling <sc...@rcn.com>.
> -----Original Message-----
> From: Nathan.S.Cuka@mail.sprint.com
> [mailto:Nathan.S.Cuka@mail.sprint.com]
[...]
>
> I am trying top get junitreport to work in Ant 1.5.1, but I am getting
> ClassNotFound exceptions for the
> org.apache.xalan.xslt.extensions.Redirect
> class.  I have Xalan-J 2.4.1 downloaded and the xalan.jar, xml-apis.jar,
> xercesImpl.jar, and xmlParserAPIs.jar are all in my classpath when
> I run the task, but it still fails.

By "in my classpath" do you mean in your CLASSPATH environment variable, or
Ant's lib dir, or a forking task in your build target?  Try putting
xalan.jar in %ANT_HOME%/lib with the other XML jars you mentioned.  I am
using the style/xslt tasks and they work fine (with Xalan 2.4.1) with Sun
and IBM 1.3.x JDKs.

> Furthermore, I have looked through
> all the jar files that come with the xalan 2.4.1 distro (BCEL, bsf,
> etc..) and can not find a reference to this class.

I know, if you look in the archive of this list on 12/8/2002 you can see
where I mentioned something similar, but in relation to a different problem.
Here's my observation:

[12/8/2002]
*******
... line 134 [of] the [JUnit] XSL file [...] invokes a custom XSL function:

<redirect:write file="{$output.dir}/{$package.dir}/{@name}.html">

Which is mapped in the XSL page to this class:

xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"

The only thing that jumps out there, but doesn't seem to really explain
anything, is that in the xalan.jar file, the Redirect class is actually in
org.apache.xalan.lib.Redirect.
*******

Given the package of the class and the xmlns:redirect attribute of the
stylesheet, I'm not sure why it works, but I don't think the namespace
necessarily has to map to a real class as long as it makes the redirect
namespace in the XSL unique.  I haven't looked at Xalan's source, but I
assume the loading of the Redirect class is resolved regardless of the
seeming misleading package shown in the XSL.

In any event, it works for me putting these jars in ANT_HOME/lib:
xalan.jar
xml-apis.jar
xercesImpl.jar

Scott Stirling



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>