Announcement Announcement Module
Collapse
No announcement yet.
Quartz through Command Line Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 03:26 PM.

  • #2
    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

    Comment

    Working...
    X