Unable to store job because one already exists with this identification

Check for existing job before scheduling:

JobDetail job;
SimpleTrigger trigger;

//Create your trigger and job

Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
scheduler.start();

if (scheduler.checkExists(job.getKey())){
    scheduler.deleteJob(job.getKey());
}
scheduler.scheduleJob(job, trigger);

You can:

  • check if the "job key" already exists, and remove the existing job before creating a new one:

    scheduler.deleteJob(job1Key);

  • or create a new job with another key (in your case, each time you execute scheduleJobs(), variable i has the same value (0)

  • or just re-use the same job (why would you create a new job if the old one is still good)

  • or use the RAM Job Store, which does not persist jobs in database (each time you will use your software, you will have an empty job store)

It really depends on what you want to do with your jobs!