ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: Custom Task and classloader problem ?
Date Mon, 05 Mar 2001 23:59:35 GMT

----- Original Message -----
From: "Vincent Massol" <vmassol@octo.fr>
To: <ant-dev@jakarta.apache.org>
Sent: Monday, March 05, 2001 10:28
Subject: Re: Custom Task and classloader problem ?


> After some digging through the Ant source, I found that if I don't define
> any nested classpath in my taskdef tasks, then the AntClassLoader will not
> be used ... So I added my jar to the classpath used to start Ant and
removed
> the nested classpath to my task definitions ... and it worked ...
>
> However, I would prefer to keep these classpaths in the task definition.
If
> there is some way to do this, please let me know.
>

I dont have a fix for this; I always stick my extensions in ant/lib and it
works.

Classloaders and indeed classpaths confuse me. Last friday I was being hit
by the fact that sticking crimson.jar in a .war wasnt making it findable;
this week it is probably the same thing on a different j2ee server, one that
isnt failing as gracefully as Tomcat, plus installing jbuilder made a mess
of java1.2.2 and java1.3 paths and to get debugging to work I have had to
faff around for ages (*). It's a shame that we have handicapped a platform
independent execution environment with a very platform dependent
configuration mechanism.

There is a little article on developmentor, "Understanding Class.forName() "
which goes into some of the detail regarding class name lookup in the JRE,
where there is already >1 classname resolver [ look
under -http://www.develop.com/dm/dev_resources.asp , its a zipped word file
for no real reason].

The core message from that paper is that we should really consider pulling
Class.forName() out of all the taskdefs and put it inside a helper class
that we can extend to deal with more complex class resolution problems than
before. It doesnt mean that we need to deal with those problems right now,
just that a refactoring will make it possible.

-Steve



(*) If anyone now wants an edited version of the win2k environment settings
control panel with wider entry panes for editing env variables, drop me a
note



Mime
View raw message