ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmose <>
Subject Re: classsnotfound exception with junit ant task
Date Wed, 16 Aug 2006 21:50:48 GMT

Well, the answer seems to be my own ignorance of ant. <filepath ... /> within
<classpath> did the trick (vs. pathelement path="...\*.jar" />)

Joel Klein wrote:
> cmose wrote:
>>classpath.project is defined thusly:
>><path id="classpath.project">
>>   <pathelement path="${target.dir}" /> --->this is the bin directory for
>>class files
>>   <pathelement path="D:\Lirbaries\*.jar" /> ---> a temporary location for
>>jar libraries
> Where in this classpath is the missing class supposed to be found?  If 
> it's supposed to be in the second pathelement above, there's a couple 
> things to check.
> The "Lirbaries" is a typo of "Libraries" (check what the actual 
> directory is called). Also, I don't know if the wildcard (*.jar) is 
> allowed in a path attribute value.  If not, then that pathelement might 
> not be doing anything.
>>Now the obnoxious thing is this, Ant runs the junit tests and manages to
>>through 65 out of the 72 testcases before throwing the classnotfound
>>exception. Furthermore,
>>The class it's saying it can't find, it found in a testcase it ran
>>to the failed testcase (e.g., ClassNotFoundException: MyClass, MyClass was
>>already exercised in a previous testcase that the ant junit task ran
> Was MyClass "exercised" the same way that the failed test uses it?  I 
> wonder if it's possible that MyClass appears to be exercised in the 
> passing test but isn't.  A simple statement like 
> System.out.println(MyClass.class.getName()) should force it to be loaded 
> so you can confirm whether it can be found or not.
> Are there by any chance any classloaders involved in this whole mess 
> that could be finding MyClass a different way than the classpath in the 
> test that uses it but doesn't fail?
> -- 
> Joel Klein                    [Online at]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View this message in context:
Sent from the Ant - Users forum at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message