cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: Ant Class Loading & CocoonTask
Date Thu, 09 Oct 2003 13:23:51 GMT

On Thursday, Oct 9, 2003, at 14:19 Europe/Rome, Upayavira wrote:

> I have written a Cocoon Ant task, which is really neat, and, as Marc 
> was suggesting, it shares its config code with the CLI.
> However, I'm having some classloading problems with it. I set up an 
> AntClassLoader which points only to WEB-INF/lib, and it successfully 
> loads in CocoonBean and associated classes. When it gets into the 
> initialisation phase, however, it gets a Logger from Ant's copy of 
> Velocity, rather than from a Cocoon jar.
> How can I force the class loader to ignore Ant's classpath and just 
> use Cocoon's for everything?

Did you try forcing the classloader in the task' thread context? you 
can basically ask the current classloader, wrap it with yours and set 
that one in (this is what the ParanoidCocoonServlet does, BTW, Sylvain 
was also able to get classes directly from Eclipse without the need 

that might trigger security exceptions in protected environments, but 
ant is never used under a security manager (AFAIK).

> Any Ant experts out there?
> [I've posted on ant-dev, but thought there might be an Ant expert or 
> two over here too].
> Regards,  Upayavira

View raw message