File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring(version 2.5)+ Quartz - SchedulerFactoryBean - waitForJobsToCompleteOnShutdown Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring(version 2.5)+ Quartz - SchedulerFactoryBean - waitForJobsToCompleteOnShutdown " Watch "Spring(version 2.5)+ Quartz - SchedulerFactoryBean - waitForJobsToCompleteOnShutdown " New topic
Author

Spring(version 2.5)+ Quartz - SchedulerFactoryBean - waitForJobsToCompleteOnShutdown

Jacob Tom
Greenhorn

Joined: Mar 06, 2013
Posts: 5
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

Joined: Mar 07, 2010
Posts: 1680
    
    7

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.


[How To Ask Questions][Read before you PM me]
Jacob Tom
Greenhorn

Joined: Mar 06, 2013
Posts: 5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring(version 2.5)+ Quartz - SchedulerFactoryBean - waitForJobsToCompleteOnShutdown