ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Class cast exception with executor - class loading issue
Date Fri, 06 Nov 2009 13:47:11 GMT
On 2009-11-06, Raja Nagendra Kumar <Nagendra.Raja@tejasoft.com> wrote:

> I read from forums that it is when casting is happening like this

> Executor ex = getProject();
> 	return ((TejaMobileExecutor) ex).getDeviceBuilder();

> The class in casting (TejaMobileExecutor) may be getting loaded from a
> different classloader than the class which was created in  parents builds
> Executor class

Yes.  You must ensure all your classes are loaded using the same
classloader.  You can achieve that by using loaderref on typedef/taskdef
and using the same id everywhere.  loaderref creates a project reference
holding your classloader.

With inheritrefs set to true on your ant task - or explicit nested
reference elements of said ant task - the classloader should get
transfered from the parent to the child project.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message