Announcement Announcement Module
No announcement yet.
Trigger set using SchedulerFactoryBean issue with redeploy Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trigger set using SchedulerFactoryBean issue with redeploy

    Hi Guys,
    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?

    Thanks in advance.


  • #2
    Is your job persistent (maybe it doesn't need to be)? Also I think you can set up a Quartz job data map as a map to the bean id, not the instance, and that might help.

    But if you only see the problem on a redeploy it seems likely there is a classloader leak somewhere (maybe in Glassfish, maybe in Quartz, maybe in your own code), and you will need to get some more data on that. If you can deploy in Tomcat then it will tell you (for 6.0.24 and above) about classloader leaks when you redeploy. I don't know what to suggest for Glassfish - maybe someone else can help.

    If you can upgrade to Spring 3 there is a simpler native task scheduler feature that might be adequate for your needs. Scheduler and Quartz questions should go to the main Spring forum (not Batch related), and you might find more knowledgeable people there.


    • #3
      Thanks Dave for your inputs. It would be hard to deploy the app on tomcat server for now. But i am trying to narrow the classloader issue you pointed. If it was my code, it would not run at the configured time. As my class has just the business logic it has to perform and it is injected as below into the framework

      <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">
      <property name="triggers">
      <ref bean="jobTrigger" />

      So if my classes has a classloader issue, it would not get triggered. I will keep digging around more on this and as suggested will post this on main forum.

      Thanks again.