ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: class.forName()
Date Mon, 19 Nov 2001 07:04:30 GMT
On Sat, 17 Nov 2001, Michael Remme <mremme@braintags.de> wrote:

> the taskdef, where i am having the problem is quite complex and is
> using several own libs.

The most common reason for classloader problems with taskdefs is that
the task implementing class itself can be loaded from the system
classloader while the support libraries can not.  People who want to
do "smart" things with <junit> or <style> (i.e. don't put JUnit or
Xalan into the CLASSPATH) face this all the time.

Ant's classloader is a "good" classloader in that it behaves the way
Sun tells us to write classloaders - it asks its parent loader (the
system loader in the most common case) first to load a class.

Everything you have in your CLASSPATH or in ANT_HOME/lib will end up
in your system classloader when you run Ant.  If your task
implementation can be loaded via this classloader, it *will* be loaded
via this classloader, no matter what.  If this task now needs a class
from a library that is not in your classpath, it won't find it (as the
classloader used to load your task doesn't know about these
libraries).

>> > D-41061 Mönchengladbach
>>
>> Funny, we are almost neighbors.
> 
> Where are you from?

I live in Mönchengladbach and work in Cologne, but we better take this
off-list 8-)

Stefan

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


Mime
View raw message