I solved the problem by replacing MethodInvokingJobDetailFactoryBeanwith JobDetailFactoryBean. The configuration for it is as follows:
<bean name="myJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass" value="mypackage.MyJob" />
<property name="group" value="MY_JOBS_GROUP" />
<property name="durability" value="true" />
</bean>
However, for Autowirespring managed beans in my job class, mypackage.MyJobI added the following as the first line in my execution method:
class MyJob implements Job {
...
public void execute(final JobExecutionContext context) throws JobExecutionException {
SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
...
}
}
Hope this helps someone else facing the same problem.
source
share