Results 1 to 2 of 2

Thread: Quartz through Command Line

  1. #1

    Post Quartz through Command Line

    Hi,

    I have written a batch program and scheduling through Quatz using MY ECLISE IDE and working fine. I want to run the quartz through command line. Can you please help me to findout what i need to do to run the Quartz through commandline.

    Any input will be appreciated.

    Thanks
    Adish
    Last edited by adish1234; May 4th, 2009 at 02:26 PM.

  2. #2
    Join Date
    Mar 2009
    Posts
    19

    Default

    Hi Adish,

    You simply need to load context to start scheduler. You can do it in the following way:

    Code:
        public static void main(String[] args) throws SQLException
        {
            try {
               String [] params = new String[args.length + 1];
               params[0] = "quartz-job-launcher-context.xml";
               System.arraycopy(args, 0, params, 1, args.length);
    
               ApplicationContext context = new ClassPathXmlApplicationContext(params);
            System.out.println("Batch is configured and scheduled to run!");
    
            } catch (Exception e) {
                log.error("Can't start batch", e);
            }
        }
    You need to specify job file names you want to run as command line arguments.

    Regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •