ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmose <cjm...@gmail.com>
Subject Re: classsnotfound exception with junit ant task
Date Wed, 16 Aug 2006 20:17:58 GMT

I mis-spoke in this past message. I hadn't previously attached the source for
digester in eclipse. It looks like the error is indeed occuring in the
Digester code when it uses a classloader to attempt to load this class in
question (class referenced in the classnotfound exception). 

Still not sure what the solution to this is...
thanks!


cmose wrote:
> 
> Joel, 
> thanks much for the comments the typo was merely a typo in my
> transcription of the build file from a printout to here (it's on an
> isolated development network). There are no classloaders in use elsewhere
> that I'm familiar with (short of anything in use by junit). I'll check
> your recommendation about seeing if the class can indeed be loaded.
> (although I will amend that - I'm using the commons Digester and I've
> really no clue what that's using, although that is not involved in loading
> up this particular class).
> 
> I edited the buildfile to run just the one class that failed previously
> when the whole suite was ran (from ant, again, running this from eclipse
> shows 0 problems). The one testcase fails again outright.
> 
> 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
>>></path>
>>>  
>>>
>> 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
get
>>>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
previous
>>>to the failed testcase (e.g., ClassNotFoundException: MyClass, MyClass
was
>>>already exercised in a previous testcase that the ant junit task ran
without
>>>hiccup). 
>>>  
>>>
>> 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 http://jfkbits.blogspot.com]
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/classsnotfound-exception-with-junit-ant-task-tf2117062.html#a5839753
Sent from the Ant - Users forum at Nabble.com.


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


Mime
View raw message