ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rafael de F. Ferreira" <>
Subject Re: AntClassLoader and the system classloadr.
Date Wed, 15 Sep 2010 14:41:32 GMT
On Wed, Sep 15, 2010 at 1:27 AM, Stefan Bodewig <> wrote:
> On 2010-09-14, Rafael de F. Ferreira wrote:
>> From a cursory inspection of, it
>> seems Ant only delegates to the system ClassLoader if the class being
>> loaded belongs to a fixed set of packages[1].
> No, Ant almost always delegates to the system classloader first.
> AntClassLoader has a parentFirst option that can be used to make it look
> into its own classes before delegating when set to false (it is true by
> default).  The list of packages you've found are the packages that will
> always be loaded from the system classloader even if parentFirst is
> false.
>> I've run into an issue with ant's classloading strategy. When I try to
>> run a Java class with the <java> task, I get a ClassNotFoundException
>> for
> Are you sure the class is available from the system classloader?

Yeah, you're right. The stack trace shows that AntClassLoader tries to
load with the parent classloader, catches CNFE and then tries to find
it by looking at the path components.

I'm actually using Ant's java task from Gradle and it's probably
messing up the parent classloader...

Thanks for the help.

> Stefan
>> [1]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message