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=31415>.
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=31415

junitreport task gives a  java.lang.NoClassDefFoundError for 
org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor

           Summary: junitreport task gives a  java.lang.NoClassDefFoundError
                    for
                    org/apache/tools/ant/taskdefs/optional/junit/XalanExecut
                    or
           Product: Ant
           Version: 1.6.2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Optional Tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


In order to take advantage of the breaking of optional.jar, I put my junit.jar 
and ant-junit.jar in a separate directory (ext). i.e., I took them out of 
ant_home/lib

I use taskef in my build scripts to get ant to recognise these tasks (junit and 
junitreport)

Junit and junitreport get recognized and my tests run, but junitreport fails,  
giving me 
java.lang.NoClassDefFoundError:
org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor

XalanExecutor is a part of ant-junit.jar,
My Taskdef for junitreport is as below:
    <path id="junit.path">
            <fileset dir="${ext}">
                <include name="*.jar"/><!--this dir has junit.jar and ant-
junit.jar in it-->
            </fileset>
    </path>
    <taskdef name="junitreport" classpathref="junit.path" 
classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
    </taskdef>

Since these jars were part of the taskdef classpath, they should also have been 
loaded, rt? So this no classfound exception should not have been raised..

I got junitreport specific classes:
XMLResultAggregator.class
AggregateTransformer.class
BriefJUnitResultFormatter.class
DOMUtil$NodeFilter.class
DOMUtil$NodeListImpl.class
DOMUtil.class
Xalan1Executor.class
Xalan2Executor.class
XalanExecutor.class
XMLConstants.class
AggregateTransformer$Format.class 

along with the xls's into a new jar (junitreport.jar), and put this under 
ant_home/lib. junitreport now succeeds, if I try taskdef classpath to point to 
junitreport.jar as opposed to ant-junit.jar.

But I shouldnt have to do this. Once I have defined junitreport in taskdef, I 
shouldn't have to do anything more to make it work.

looks like a taskdef bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to