views:

203

answers:

1

Hi,

I have imported the package org.spring.schedule.timer2.5.6A. using eclipse and created the following beans. but my problem is i, dont see / cant set any property values for the bean methodInvokingTASK (last one), where I should have.

property - targetObject

property - targetMethod

I dont know what is wrong, am I missing any import or doing anything silly!!!

<bean id = "scheduledTASK" class ="org.springframework.scheduling.timer.ScheduledTimerTask">
 <property name="delay" value="1000" />
 <property name="period" value="6000"/>
 <property name="timerTask" ref="methodInvokingTASK" />
</bean>


<bean id="timerFactory" class="org.springframework.scheduling.timer.TimerFactoryBean">
 <property name="scheduledTimerTasks">
  <list>
   <ref local="scheduledTASK"/>
  </list>
 </property>
</bean>

    <bean id="methodInvokingTASK" class="org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean">

   </bean>
A: 

here we go, it shows the following errors, while deploying into spring DM-server: the trace

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodInvokingTASK' defined in URL [bundleentry://90/META-INF/spring/module-context.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Either 'targetClass' or 'targetObject' is required at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:288) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:145) at com.springsource.server.kernel.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636) Caused by: java.lang.IllegalArgumentException: Either 'targetClass' or 'targetObject' is required at org.springframework.util.MethodInvoker.prepare(MethodInvoker.java:166) at org.springframework.scheduling.support.MethodInvokingRunnable.afterPropertiesSet(MethodInvokingRunnable.java:70) at org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean.afterPropertiesSet(MethodInvokingTimerTaskFactoryBean.java:52) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335) ... 17 more

Thnaks Zakaria