ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gurdev Parmar" <gpar...@versant.com>
Subject Re: AntClassLoader leads to ClassCastException
Date Fri, 01 Mar 2002 20:22:54 GMT
Stefan,
I have made an example of the code that I was trying to
execute. I have attached a zip file of that here. I have also
attached a log of relevant debug here.

It's very simple unzip my stuff in a tmp dir.
go to src_and_compile_dir and run ant. It will compile
and make the required jar files. then go to ../run_dir
and run ant in debug mode to run the stuff I compiled.
you will see the the ClassCastException.

The two Ant Classloaders that you talked of is, I am sure,
because of the taskdef activity that I do.

Thanks for spending your valuable time on this,

Gurdev.

----- Original Message -----
From: "Stefan Bodewig" <bodewig@apache.org>
To: <ant-user@jakarta.apache.org>
Sent: Thursday, February 28, 2002 6:06 AM
Subject: Re: AntClassLoader leads to ClassCastException


> On Wed, 27 Feb 2002, Gurdev Parmar <gparmar@versant.com> wrote:
>
> > You seem to be the only person interested in sorting out ClassLoader
> > stuff :)
>
> I've made myself the victim 8-)
>
> > I agree, I was using forceLoadClass in my original code.
>
> If you don't longer do so, please show your latest code and the latest
> -debug log.
>
> > It doesn't make much difference, anyways. Right? Because the parent
> > classloader doesn't have TestClient and TestEjbSelect classes.
>
> In this case it shouldn't make any difference, only that they give
> different results in the log.
>
> > I am not instantiating two instances of AntClassLoader as you
> > had pointed out.
>
> At least you are loading TestClient twice (your log file says so).
>
> > I create one instance in execute() and call createDynamically() from
> > there.
>
> Are you sure that execute doesn't get called more than once?
>
> If you do "ant A B" and both A and B depend on target C, then C will
> be run twice and the task instances for task in C will get reused.
>
> 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