ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sadaf_Choudhry" <Sadaf_Choud...@infosys.com>
Subject RE: Problem with junitreport and ant 1.6.2
Date Fri, 24 Sep 2004 21:33:31 GMT
Is there anybody who can help me with this??
I have defined the junitreport task with ant-junit.jar in my classpath,
Then why do I get 
 java.lang.NoClassDefFoundError:
org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor
This class is in ant-junit.jar, I checked... Why is it not getting
picked up by junitreport?

Please, Is there anybody who can help me with this?

Sadaf 

-----Original Message-----
From: Sadaf_Choudhry 
Sent: Friday, September 24, 2004 11:21 AM
To: Ant Users List
Subject: RE: Problem with junitreport and ant 1.6.2

I think I should point out that I am talking about the problem below:

 java.lang.NoClassDefFoundError:
org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor

Now I had defined junitreport task and had ant-junit.jar and junit.jar
in classpath And XalanExecuter.class is a part of ant-junit.jar...
        <taskdef name="junitreport"
classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggrega
tor">
            <classpath>
                <fileset dir="${ext}">
                    <include name="**/*.jar"/>
                </fileset>
            </classpath>
        </taskdef>

So why this exception?
When I put junitreport specific classes in a separate jar and put it in
ant_home/lib, it works (maybe because ant_home/lib is added to
classpath)  And I don't get the exception.. Why? Is this a bug?

Sadaf

-----Original Message-----
From: Sadaf_Choudhry
Sent: Friday, September 24, 2004 10:24 AM
To: user@ant.apache.org
Subject: Problem with junitreport and ant 1.6.2

Hi all,
 
I have upgraded to ant 1.6.2.
I want to keep my junit.jar out of ant_home/lib.
 
So I kept ant-junit.jar and junit.jar in a separate directory (ext).
 
In my build script I have 
 
        <taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
            <classpath>
                <fileset dir="${ext}">
                    <include name="**/*.jar"/>
                </fileset>
            </classpath>
        </taskdef>
 
        <taskdef name="junitreport"
classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggrega
tor">
            <classpath>
                <fileset dir="${ext}">
                    <include name="**/*.jar"/>
                </fileset>
            </classpath>
        </taskdef>
 
While running tests, i get :
 
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 6.313 sec
BUILD FAILED
C:\home\sadaf\work\Engineering\Configuration\ant\testbuild.xml:180: The
following error occurred whi le executing this line:
java.lang.NoClassDefFoundError:
org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor
 
I do not have ant-junit.jar inside ant_home/lib anymore: 
 
I figure that is the problem... 
So I broke ant-junit.jar and put the classes related to junitreport into
a separate jar, junitreport.jar.
I put this junitreport.jar inside ant_home/lib... and it worked..!!
 
But when I tried to look this thing up, I found nothing on the net (read
google)..
Seems nobody else had this problem... So I wonder if the way I tried it
was wrong...
Is there anybody who could get junit.jar out of ant_home/lib smoothly?
and how did you do it??
(I am not very comfortable breaking jars)
 
if anybody has something to say on this, please do reply  ...
 
Thanks
Sadaf
 
PS: sorry for the big mail


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



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


Mime
View raw message