Reputation: 5236
I am trying to call a custom method with null parameter. I am trying to use arguments property with element. But I am getting below error. Is there any way to do this?
<bean id="customJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="customExecutor" />
<property name="targetMethod" value="run" />
<property name="arguments">
<null/>
</property>
</bean>
I am getting below error;
Error creating bean with name 'customJob'
java.lang.NoSuchMethodException: total.scheduler.CustomExecutor.run()
My CustomExecutor class method;
public void run(Object object){
....
}
Upvotes: 0
Views: 178
Reputation: 5361
Try following code:
<bean id="customJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="customExecutor" />
<property name="targetMethod" value="run" />
<property name="arguments">
<property name="arguments">
<list>
<null/>
</list>
</property>
</bean>
Upvotes: 2