Hi,
I am using Spring 1.2.4 with a scheduled task which works (!) but when I try to get a reference to the bean within the code it produces a class cast exception. I have the following configuration:
<bean id="methodInvokingTask" class="org.springframework.scheduling.timer.Method InvokingTimerTaskFactoryBean">
<property name="targetObject">
<ref local="applicationMonitor"/>
</property>
<property name="targetMethod">
<value>queueSize</value>
</property>
</bean>
<bean id="scheduledTask" class="org.springframework.scheduling.timer.Schedu ledTimerTask">
<property name="delay">
<value>10000</value>
</property>
<property name="period">
<value>5000</value>
</property>
<property name="timerTask">
<ref local="methodInvokingTask"/>
</property>
</bean>
<bean id="timerScheduler" class="org.springframework.scheduling.timer.TimerF actoryBean">
<property name="scheduledTimerTasks">
<list>
<ref bean="scheduledTask"/>
</list>
</property>
</bean>
In the code I have the following (which produces the exception):
org.springframework.scheduling.timer.TimerFactoryB ean timerScheduler = (org.springframework.scheduling.timer.TimerFactory Bean) m_springBeanFactory.getBean("timerScheduler");
Does anyone know why this is happening ?
thanks


Reply With Quote
