(Posted on behalf of the OP).
Solution:
In the Job (it is mandatory to get an Interface):
public class SchedulerJob extends QuartzJobBean {
public void executeInternal(JobExecutionContext context)
throws JobExecutionException {
try{
<YOUR_BEAN_DAO_INTERFACE_OBJECT> = ((ApplicationContext) context.getJobDetail().getJobDataMap().get("applicationContext")).get("<YOUR_BEAN_DAO_INTERFACE_ID>");
} catch (Exception e ){
e.printStackTrace();
return;
}
}
}
In the .xml context of the application: It is also necessary to declare <YOUR_BEAN_DAO_INTERFACE>
in this XML as a bean:
<!-- Spring Quartz Scheduler job -->
<bean name="schedulerJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="<PATH_OF_YOUR_CLASS_JOB>.SchedulerJob" />
<property name="applicationContextJobDataKey" value="applicationContext" />
</bean>
<!-- Cron Trigger, run every 10 seconds -->
<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="schedulerJob" />
<property name="cronExpression" value="0/10 * * * * ?" />
</bean>
<!-- DI -->
<bean id="scheduler"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="jobDetails">
<list>
<ref bean="schedulerJob" />
</list>
</property>
<property name="triggers">
<list>
<ref bean="cronTrigger" />
</list>
</property>
</bean>