Results 1 to 3 of 3

Thread: Questions of running job by Quartz

  1. #1

    Default Questions of running job by Quartz

    Hi,
    I am trying to use Quartz running my batch job by following the spring-batch examples.
    I can run my job successfully at first time, however, the job could not be started by Quartz for the next instance. Looking at exception, it looks like that Quartz could not generate new parameters for one batch job to mark it is a new instance.
    Is it a known issue? or should we make Quartz passing the current time as one parameter to start a new job instance ?

    Code:
    10:34:00,437 ERROR DefaultQuartzScheduler_Worker-0 JobLauncherDetails:75 - Could not execute job.
    org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={}{}{}{}.  If you want to run this job again, change the parameters.
    	at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:171)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    	at $Proxy0.createJobExecution(Unknown Source)
    	at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:79)
    	at org.springframework.batch.sample.quartz.JobLauncherDetails.executeInternal(JobLauncherDetails.java:72)
    	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
    	at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
    	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    David Yinwei Liu

  2. #2

    Default

    Is it a known issue? or should we make Quartz passing the current time as one parameter to start a new job instance ?
    Yes, you need to create a new job instance unless you want to restart an existing one (and restart makes sense only if the previous execution failed). Passing timestamp as job parameter is a common way to create a new instance.

  3. #3

    Default

    thanks for reply. i see.
    David Yinwei Liu

Posting Permissions

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