Announcement Announcement Module
No announcement yet.
Batch: incrementer doesn't work for quartz job Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch: incrementer doesn't work for quartz job

    Incrementer works for regular launch from Spring Batch Admin console any number of times but it doesn't work for the same job using quartz.

    [INFO ] [2010-12-02 12:46:29,558] [ leJobLauncher] - Job: [FlowJob: [name=scbcideptJob]] completed with the following parameters: [{}] and the following status: [COMPLETED]

    [INFO ] [2010-12-02 12:46:57,916] [org.springframework.beans.factory.xml.XmlBeanDefin itionReader] - Loading XML bean definitions from scbcideptCronJob.xml
    [INFO ] [2010-12-02 12:46:57,963] [org.springframework.beans.factory.xml.XmlBeanDefin itionReader] - Loading XML bean definitions from class path resource [jobs/scbcideptJob.xml]

    [INFO ] [2010-12-02 12:46:58,631] [org.quartz.simpl.RAMJobStore] - RAMJobStore initialized.
    [INFO ] [2010-12-02 12:46:58,631] [org.quartz.impl.StdSchedulerFactory] - Quartz scheduler 'org.springframework.scheduling.quartz.SchedulerFa ctoryBean#0' initialized from an externally provided properties instance.
    [INFO ] [2010-12-02 12:46:58,631] [org.quartz.impl.StdSchedulerFactory] - Quartz scheduler version: 1.5.2
    [INFO ] [2010-12-02 12:46:58,631] [org.quartz.core.QuartzScheduler] - JobFactory set to: org.springframework.scheduling.quartz.AdaptableJob [email protected]
    [INFO ] [2010-12-02 12:46:58,632] [ leProcessor] - Starting beans in phase 2147483647
    [INFO ] [2010-12-02 12:46:58,632] [org.springframework.scheduling.quartz.SchedulerFac toryBean] - Starting Quartz Scheduler now
    [INFO ] [2010-12-02 12:46:58,632] [org.quartz.core.QuartzScheduler] - Scheduler org.springframework.scheduling.quartz.SchedulerFac toryBean#0_$_NON_CLUSTERED started.
    [INFO ] [2010-12-02 12:46:58,661] [org.springframework.integration.handler.LoggingHan dler] - Registered jobs: [scbcideptJob]
    [INFO ] [2010-12-02 12:47:00,042] [org.springframework.batch.sample.quartz.JobLaunche rDetails] - Quartz trigger firing with Spring Batch jobName=scbcideptJob
    [ERROR] [2010-12-02 12:47:00,935] [org.springframework.batch.sample.quartz.JobLaunche rDetails] - Could not execute job.
    org.springframework.batch.core.repository.JobResta rtException: JobInstance already exists and is not restartable
    at org.springframework.batch.sample.quartz.JobLaunche rDetails.executeInternal( 2)
    at org.springframework.scheduling.quartz.QuartzJobBea n.execute(
    at 03)
    at org.quartz.simpl.SimpleThreadPool$ (

  • #2

    you can see the problem into you stacktrace :

    JobInstance already exists and is not restartable

    The job can be started only once. You need to create for every execution a new job instance and not simply try to relaunch the same job. Batch admin console create a new instance every time and don't try to restart same job.

    PS: for schedunling job have a look at task namespace of spring 3.x core. You will get something like

    <task:scheduled-tasks scheduler="scheduler">
    <task:scheduled ref="myBatchProcessorInvoker" method="invoke" cron="*/5 * 9-17 * * MON-FRI"/>

    and don't need all quartz configurations.