Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7527571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:08:24+00:00 2026-05-30T04:08:24+00:00

I am using Quartz 2.0.1 scheduler from StdSchedulerFactory . I am catching SchedulerException in

  • 0

I am using Quartz 2.0.1 scheduler from StdSchedulerFactory.

I am catching SchedulerException in my code.

Should I shutdown the scheduler in a finally block:

} finally {
    scheduler.shutdown();
}

or should I do the shutdown in the try block?

The shutdown method can throw SchedulerException, so it seems the shutdown should not be in the finally block.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:08:25+00:00Added an answer on May 30, 2026 at 4:08 am

    You don’t have to do it in the finally block in any case because if the scheduler is started successfully it won’t throw the SchedulerException and hence if you are reaching the catch block of SchedulerException that means the scheduler was never started. So, you should not shutdown a scheduler that is never started.

    Here is a sample program from the project homepage.

    public class QuartzTest {
    
        public static void main(String[] args) {
    
            try {
                // Grab the Scheduler instance from the Factory 
                Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
    
                // and start it off
                scheduler.start();
    
                scheduler.shutdown();
    
            } catch (SchedulerException se) {
                se.printStackTrace();
            }
        }
    }
    

    Also, from the above link,

    Once you obtain a scheduler using StdSchedulerFactory.getDefaultScheduler(), your application will not terminate until you call scheduler.shutdown(), because there will be active threads.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a simple scheduler using Quartz.NET, but when I try to
I am using Quartz Enterprise Job Scheduler (1.8.3). The job configuration comes from several
I'm using Quartz.NET scheduler as a stand-alone windows service while from an ASP.NET app
I'm using quartz 1.6.5. I recently moved from Quartz Job Store from RamJobStore to
I am currently using Quartz Scheduler for asynchronous tasks such as sending an email
I am using quartz scheduler in my spring project. I have to run a
Friends, I am using quartz scheduler for running a task every 5 minutes starting
I'm using Quartz.NET to schedule a job which loads a bunch of data from
I am using Quartz.NET, and my scheduler relies heavily on the use of cron
Was planning to move from setting up cron jobs to Quartz scheduler. What are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.