use of org.springframework.batch.core.launch.NoSuchJobException in project spring-boot by spring-projects.
the class JobLauncherCommandLineRunner method executeRegisteredJobs.
private void executeRegisteredJobs(JobParameters jobParameters) throws JobExecutionException {
if (this.jobRegistry != null && StringUtils.hasText(this.jobNames)) {
String[] jobsToRun = this.jobNames.split(",");
for (String jobName : jobsToRun) {
try {
Job job = this.jobRegistry.getJob(jobName);
if (this.jobs.contains(job)) {
continue;
}
execute(job, jobParameters);
} catch (NoSuchJobException ex) {
logger.debug("No job found in registry for job name: " + jobName);
continue;
}
}
}
}
Aggregations