Having not luck using the Quartz Scheduler. Any and all help would be much appreciated! I assure you have all the required dependencies in my pom.
Here's my spring-config.xml.
<bean id="testObject" class="test.Test"/>
<bean id="jobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="testObject"/>
<property name="targetMethod" value="print"/>
</bean>
<bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
<!-- see the example of method invoking job above -->
<property name="jobDetail" ref="jobDetail"/>
<property name="startDelay" value="1000"/>
<property name="repeatInterval" value="5000"/>
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" >
<property name="jobDetails">
<list>
<ref bean="jobDetail" />
</list>
</property>
<property name="triggers">
<list>
<ref bean="simpleTrigger"/>
</list>
</property>
<property name="autoStartup" value="true"/>
</bean>
And here's my Test class... very simple.
package test;
public class Test {
public Test(){};
public void print(){System.out.println("asdfasdfasdf!!!!!\n\n\n\n");}
}
And the output is this...
15:11:46.550 [main] INFO org.quartz.core.QuartzScheduler - Scheduler meta-data: Quartz Scheduler (v2.1.7) 'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' with instanceId 'NON_CLUSTERED' Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally. NOT STARTED. Currently in standby mode. Number of jobs executed: 0 Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads. Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.
I should've shown the rest of the xml file. There was an other bean in the file with an init-method that was preventing the quartz scheduler from starting.