ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raja Nagendra Kumar <>
Subject Class cast exception with executor - class loading issue
Date Fri, 06 Nov 2009 11:51:51 GMT


When using the custom executor with taskdef's loaded from project classpath,
I see class cast exception when trying to fetch the executor from project
and casting it to custom class.

com.tejasoft.ant.utils.executor.TejaMobileExecutor cannot
 be cast to com.tejasoft.ant.utils.executor.TejaMobileExecutor

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

 public Executor getSubProjectExecutor()
	return new TejaMobileExecutor();
	//return this;

How to resolve such issue as getSubProjectExecutor() should use parent
builds class loader wher as casting to be done in subproject.

Raja Nagendra Kumar,
View this message in context:
Sent from the Ant - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message