-
Mar 26th, 2012, 01:21 PM
#1
ClasscastException on a TaskExecutor
Hi,
I am working on parallel processing of tasks and am using threadpooltask executor
But I am getting a class cast exception on a class when I cast it to the class which has the task to be run in parallel.
TaskExecutor te =(TaskExecutor)ctx.getBean("exportTaskThreadExecut or",ExportTaskThreadExecutor.class);
and this is my config..
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd" >
<bean id="tPExecutor" class="org.springframework.scheduling.concurrent.T hreadPoolTaskExecutor">
<property name="corePoolSize" value="5" />
<property name="maxPoolSize" value="10" />
<property name="queueCapacity" value="15" />
</bean>
<bean id ="exportTaskThreadExecutor" class = ".../ExportTaskThreadExecutor">
<constructor-arg ref="tPExecutor" type="org.springframework.core.task.TaskExecutor"/>
</bean>
</beans>
Am I doing something wrong?
Please help.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules