Mar 7th, 2011, 03:35 PM
Trigger set using SchedulerFactoryBean issue with redeploy
I am using spring 2.5.6 and quartz 1.6 to run some job every 3 minutes using SchedularFactoryBean and SimpleTriggerBean and every works fine. Now if i just redeploy my app without restarting the Glassfish server. I see duplicate jobs one referencing the targetObject before redeploy and one with new reference. I see the job with reference to new object instance working fine, but the job with old targetObject reference fails. It seems in the process of redeployment it serializes the job with the targetObject reference and once the app is up it deserializes and runs it. Note: If i restart it works fine i don't see the duplicate job with the old targetObject reference.
Any idea if something can be done to solve this during redeployment?
The configuration looks like below
<bean id="job" class="org.springframework.scheduling.quartz.Metho dInvokingJobDetailFactoryBean">
<property name="targetObject" ref="businessLogic" />
<property name="targetMethod" value="performCleanUp" />
<property name="concurrent" value="false" />
and then injected into the SimpleTriggerBean as jobDetail
<bean id="jobTrigger" class="org.springframework.scheduling.quartz.Simpl eTriggerBean">
<property name="jobDetail" ref="job" />
<bean class="org.springframework.scheduling.quartz.Sched ulerFactoryBean">
<ref bean="jobTrigger" />
Thanks in advance.