I figured out what was going on.  You were correct it was the classloaders.
I was running the tasks as class files that I was including at run time in
my script.  

I put the offending code into a jar and put it into my ant/lib directory and
everything worked perfectly.

Don

-----Original Message-----
From: Keith Hatton [mailto:[EMAIL PROTECTED]
Sent: Friday, January 23, 2004 8:52 AM
To: Ant Users List
Subject: RE: Tasks and TaskContainer


>>This makes absolutely no sense what so ever, however this is how I worked
around the ClassCastException:

I ended up using reflection.  I am in severe doubt of my sanity and skills
as a programmer.
<<

All of the above could be explained with the word "classloaders". Without
knowing the detail, it sounds as if your task is loaded by a different
classloader to the one that loaded the child task, so the class you are
trying to cast to is not the same class, hence the ClassCastException, and
also hence why reflection works.

Looking into this further will probably not improve your sanity in the
short-term :)

Keith

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to