Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring(version 2.5)+ Quartz - SchedulerFactoryBean - waitForJobsToCompleteOnShutdown

 
Jacob Tom
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

As per the documentation of property "waitForJobsToCompleteOnShutdown" within "org.springframework.scheduling.quartz.SchedulerFactoryBean", Spring should wait for running jobs to complete before shutdown.

I have configured the scheduler in spring configuration xml as shown below -


I also have configured correponding trigger and job. Then I am scheduling the job using the scheduler.

This Spring module is deployed on weblogic 8.1.

When a 'shutdown' is issued from weblogic, it appears that weblogic does not wait for the spring job to complete before shutdown even though 'waitForJobsToCompleteOnShutdown' is set to TRUE.

Could you please advice what could be wrong?

Please let me know if you need any more details.

Regards,
Jacob
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is Weblogic issuing a graceful shutdown to the Spring context? It is the context closing event that handles this, it has nothing to do with Weblogic. You can test this by running it in a standalone application and calling close on the context. If Weblogic won't wait there is nothing you can do.
 
Jacob Tom
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill for reply.

Weblogic is issuing graceful shutdown. Please find below class that extends "ContextLoaderListener". Is there anything I need to do more in the "contextDestroyed" method to ensure that weblogic waits till all my currently running jobs are finished before shutting down?



Regards,
Jacob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic