org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={report.date=1431586800000}. If you want to run this job again, change the parameters.

Spring JIRA | Trevor Baker | 2 years ago
  1. 0

    Using the CommandLineJobRunner I pass in some non-identifying parameters but when I rerun with the same parameter, SimpleJobRepository throws an exception: {noformat} 2015-05-14 12:03:58,414 [ERROR] org.springframework.batch.core.launch.support.CommandLineJobRunner#start:368 | Job Terminated in error: A job instance already exists and is complete for parameters={report.date=1431586800000}. If you want to run this job again, change the parameters. org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={report.date=1431586800000}. If you want to run this job again, change the parameters. at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:126) {noformat} This is because SimpleJobRepository only checks the number of JobParameters but doesn't check if they are identifying or not. {code:java} BatchStatus status = execution.getStatus(); if (execution.getJobParameters().getParameters().size() > 0 && (status == BatchStatus.COMPLETED || status == BatchStatus.ABANDONED)) { throw new JobInstanceAlreadyCompleteException( "A job instance already exists and is complete for parameters=" + jobParameters + ". If you want to run this job again, change the parameters."); } {code} Related Jira: BATCH-1412

    Spring JIRA | 2 years ago | Trevor Baker
    org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={report.date=1431586800000}. If you want to run this job again, change the parameters.
  2. 0

    Using the CommandLineJobRunner I pass in some non-identifying parameters but when I rerun with the same parameter, SimpleJobRepository throws an exception: {noformat} 2015-05-14 12:03:58,414 [ERROR] org.springframework.batch.core.launch.support.CommandLineJobRunner#start:368 | Job Terminated in error: A job instance already exists and is complete for parameters={report.date=1431586800000}. If you want to run this job again, change the parameters. org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={report.date=1431586800000}. If you want to run this job again, change the parameters. at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:126) {noformat} This is because SimpleJobRepository only checks the number of JobParameters but doesn't check if they are identifying or not. {code:java} BatchStatus status = execution.getStatus(); if (execution.getJobParameters().getParameters().size() > 0 && (status == BatchStatus.COMPLETED || status == BatchStatus.ABANDONED)) { throw new JobInstanceAlreadyCompleteException( "A job instance already exists and is complete for parameters=" + jobParameters + ". If you want to run this job again, change the parameters."); } {code} Related Jira: BATCH-1412

    Spring JIRA | 2 years ago | Trevor Baker
    org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={report.date=1431586800000}. If you want to run this job again, change the parameters.
  3. 0

    Spring batch A job instance already exists

    Stack Overflow | 2 years ago | Petar Tahchiev
    org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={catalogVersionPK=3378876823725152, type=UPDATE}. If you want to run this job again, change the parameters.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring Batch : A job instance already exists and is complete for parameters={}

    mkyong.com | 11 months ago
    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.
  6. 0

    Spring Batch 'RunIdIncrementer' not generating next value

    Stack Overflow | 3 years ago | Greg
    org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={run.id=23, tenant.code=XXX}. If you want to run this job again, change the parameters.

  1. tvrmsmith 1 times, last 4 months ago
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException

    A job instance already exists and is complete for parameters={report.date=1431586800000}. If you want to run this job again, change the parameters.

    at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution()
  2. Spring Batch Core
    SimpleJobRepository.createJobExecution
    1. org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:126)
    1 frame