org.quartz.ObjectAlreadyExistsException: Unable to store Trigger with name: 'test' and group: 'test', because one already exists with this identification.

Terracotta Project Issue Tracker | Vladimir Nicolici | 7 years ago
  1. 0

    I started testing the Quartz Scheduler for performance, first with RAM Store, then with JDBC Store Cluster, and finally with TerracottaJobStore. I was not able to complete the TerracottaJobStore tests, due to the bug. I used Windows 7 x64, jdk1.6.0_17 64-Bit, and Terracotta 3.2.0 without permanent-store. Within a test class, I scheduled a few hundred jobs with SimpleTrigger, with start times distributed randomly within one minute, and no repeat. I started the scheduler, and everything went fine, the jobs ran at their scheduled time. I stopped the application with End Process from task manager. Then I tried to run the application again, without restarting the Terracotta server, but I received this error: Exception in thread "main" org.quartz.ObjectAlreadyExistsException: Unable to store Job with name: 'test' and group: 'test', because one already exists with this identification. at org.terracotta.quartz.ClusteredJobStore.storeJob(ClusteredJobStore.java:329) at org.terracotta.quartz.ClusteredJobStore.storeJobAndTrigger(ClusteredJobStore.java:305) at org.terracotta.quartz.PlainTerracottaJobStore.storeJobAndTrigger(PlainTerracottaJobStore.java:196) at org.terracotta.quartz.TerracottaJobStore.storeJobAndTrigger(TerracottaJobStore.java:513) at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:743) at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:243) at ro.objects.quartz.test.TerracottaQuartzBug.main(TerracottaQuartzBug.java:38) This didn't happen when I used an Oracle database as the store. The jobs were cleared from the database after the jobs were executed. I don't know if this is another bug, or the intended behaviour, but I attempted to find a workaround, so I added a deleteJob call before scheduling, to remove any old jobs with the same name as the new jobs, like this: scheduler.deleteJob("test", "test"); I tried to run the test again, but I received a different exception: Exception in thread "main" org.quartz.ObjectAlreadyExistsException: Unable to store Trigger with name: 'test' and group: 'test', because one already exists with this identification. at org.terracotta.quartz.ClusteredJobStore.storeTrigger(ClusteredJobStore.java:403) at org.terracotta.quartz.ClusteredJobStore.storeJobAndTrigger(ClusteredJobStore.java:306) at org.terracotta.quartz.PlainTerracottaJobStore.storeJobAndTrigger(PlainTerracottaJobStore.java:196) at org.terracotta.quartz.TerracottaJobStore.storeJobAndTrigger(TerracottaJobStore.java:513) at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:743) at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:243) at ro.objects.quartz.test.TerracottaQuartzBug.main(TerracottaQuartzBug.java:38) The job was deleted, but the trigger remained, although the JavaDoc specifies that deleteJob should delete both the job and the trigger: boolean deleteJob(String jobName, String groupName) throws SchedulerException - Delete the identified Job from the Scheduler - and any associated Triggers. So, after also restarting the Terracotta server and running the application successfully one time, I tried to delete the trigger before deleting the job, to workaround the new bug, adding a new line before the deleteJob line: scheduler.unscheduleJob("test", "test"); scheduler.deleteJob("test", "test"); And, of course, I received a new exception: Exception in thread "main" java.lang.NullPointerException at org.terracotta.quartz.ClusteredJobStore.removeTrigger(ClusteredJobStore.java:483) at org.terracotta.quartz.ClusteredJobStore.removeTrigger(ClusteredJobStore.java:450) at org.terracotta.quartz.PlainTerracottaJobStore.removeTrigger(PlainTerracottaJobStore.java:136) at org.terracotta.quartz.TerracottaJobStore.removeTrigger(TerracottaJobStore.java:445) at org.quartz.core.QuartzScheduler.unscheduleJob(QuartzScheduler.java:863) at org.quartz.impl.StdScheduler.unscheduleJob(StdScheduler.java:290) at ro.objects.quartz.test.TerracottaQuartzBug.main(TerracottaQuartzBug.java:31) I restarted the Terracotta server and repeated the tests but now I called deleteJob before calling unscheduleJob, like this: scheduler.deleteJob("test", "test"); scheduler.unscheduleJob("test", "test"); I received the same NullPointerException. So it seems there is no way to delete the trigger (which should have probably deleted itself after the job execution anyway), except restarting the Terracotta server. And probably restarting it would not have helped if I had configured a permanent store for Terracotta. I attached a class that reproduces the bug, and the Terracotta cluster configuration file.

    Terracotta Project Issue Tracker | 7 years ago | Vladimir Nicolici
    org.quartz.ObjectAlreadyExistsException: Unable to store Trigger with name: 'test' and group: 'test', because one already exists with this identification.
  2. 0

    I started testing the Quartz Scheduler for performance, first with RAM Store, then with JDBC Store Cluster, and finally with TerracottaJobStore. I was not able to complete the TerracottaJobStore tests, due to the bug. I used Windows 7 x64, jdk1.6.0_17 64-Bit, and Terracotta 3.2.0 without permanent-store. Within a test class, I scheduled a few hundred jobs with SimpleTrigger, with start times distributed randomly within one minute, and no repeat. I started the scheduler, and everything went fine, the jobs ran at their scheduled time. I stopped the application with End Process from task manager. Then I tried to run the application again, without restarting the Terracotta server, but I received this error: Exception in thread "main" org.quartz.ObjectAlreadyExistsException: Unable to store Job with name: 'test' and group: 'test', because one already exists with this identification. at org.terracotta.quartz.ClusteredJobStore.storeJob(ClusteredJobStore.java:329) at org.terracotta.quartz.ClusteredJobStore.storeJobAndTrigger(ClusteredJobStore.java:305) at org.terracotta.quartz.PlainTerracottaJobStore.storeJobAndTrigger(PlainTerracottaJobStore.java:196) at org.terracotta.quartz.TerracottaJobStore.storeJobAndTrigger(TerracottaJobStore.java:513) at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:743) at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:243) at ro.objects.quartz.test.TerracottaQuartzBug.main(TerracottaQuartzBug.java:38) This didn't happen when I used an Oracle database as the store. The jobs were cleared from the database after the jobs were executed. I don't know if this is another bug, or the intended behaviour, but I attempted to find a workaround, so I added a deleteJob call before scheduling, to remove any old jobs with the same name as the new jobs, like this: scheduler.deleteJob("test", "test"); I tried to run the test again, but I received a different exception: Exception in thread "main" org.quartz.ObjectAlreadyExistsException: Unable to store Trigger with name: 'test' and group: 'test', because one already exists with this identification. at org.terracotta.quartz.ClusteredJobStore.storeTrigger(ClusteredJobStore.java:403) at org.terracotta.quartz.ClusteredJobStore.storeJobAndTrigger(ClusteredJobStore.java:306) at org.terracotta.quartz.PlainTerracottaJobStore.storeJobAndTrigger(PlainTerracottaJobStore.java:196) at org.terracotta.quartz.TerracottaJobStore.storeJobAndTrigger(TerracottaJobStore.java:513) at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:743) at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:243) at ro.objects.quartz.test.TerracottaQuartzBug.main(TerracottaQuartzBug.java:38) The job was deleted, but the trigger remained, although the JavaDoc specifies that deleteJob should delete both the job and the trigger: boolean deleteJob(String jobName, String groupName) throws SchedulerException - Delete the identified Job from the Scheduler - and any associated Triggers. So, after also restarting the Terracotta server and running the application successfully one time, I tried to delete the trigger before deleting the job, to workaround the new bug, adding a new line before the deleteJob line: scheduler.unscheduleJob("test", "test"); scheduler.deleteJob("test", "test"); And, of course, I received a new exception: Exception in thread "main" java.lang.NullPointerException at org.terracotta.quartz.ClusteredJobStore.removeTrigger(ClusteredJobStore.java:483) at org.terracotta.quartz.ClusteredJobStore.removeTrigger(ClusteredJobStore.java:450) at org.terracotta.quartz.PlainTerracottaJobStore.removeTrigger(PlainTerracottaJobStore.java:136) at org.terracotta.quartz.TerracottaJobStore.removeTrigger(TerracottaJobStore.java:445) at org.quartz.core.QuartzScheduler.unscheduleJob(QuartzScheduler.java:863) at org.quartz.impl.StdScheduler.unscheduleJob(StdScheduler.java:290) at ro.objects.quartz.test.TerracottaQuartzBug.main(TerracottaQuartzBug.java:31) I restarted the Terracotta server and repeated the tests but now I called deleteJob before calling unscheduleJob, like this: scheduler.deleteJob("test", "test"); scheduler.unscheduleJob("test", "test"); I received the same NullPointerException. So it seems there is no way to delete the trigger (which should have probably deleted itself after the job execution anyway), except restarting the Terracotta server. And probably restarting it would not have helped if I had configured a permanent store for Terracotta. I attached a class that reproduces the bug, and the Terracotta cluster configuration file.

    Terracotta Project Issue Tracker | 7 years ago | Vladimir Nicolici
    org.quartz.ObjectAlreadyExistsException: Unable to store Trigger with name: 'test' and group: 'test', because one already exists with this identification.
  3. 0

    Unable to run multiple BatchSchedulers

    GitHub | 2 years ago | imranrajjad
    org.easybatch.integration.quartz.BatchSchedulerException: An exception occurred during scheduler startup
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    How to start a Job with several cron-triggers using the quartz-scheduler?

    Stack Overflow | 2 years ago
    org.quartz.ObjectAlreadyExistsException: Unable to store Job : 'group1.job1', because one already exists with this identification.
  6. 0

    Problem with deploying the server webapp

    Google Groups | 8 years ago | A.N
    org.quartz.ObjectAlreadyExistsException: Unable to store Job with name: 'ScheduledJob_0' and group: 'DEFAULT', because one already exists with this identification.

  1. Pilleo 8 times, last 2 months ago
  2. linxiaolong 2 times, last 4 months ago
1 unregistered visitors
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.quartz.ObjectAlreadyExistsException

    Unable to store Trigger with name: 'test' and group: 'test', because one already exists with this identification.

    at org.terracotta.quartz.ClusteredJobStore.storeTrigger()
  2. quartz
    StdScheduler.scheduleJob
    1. org.terracotta.quartz.ClusteredJobStore.storeTrigger(ClusteredJobStore.java:403)
    2. org.terracotta.quartz.ClusteredJobStore.storeJobAndTrigger(ClusteredJobStore.java:306)
    3. org.terracotta.quartz.PlainTerracottaJobStore.storeJobAndTrigger(PlainTerracottaJobStore.java:196)
    4. org.terracotta.quartz.TerracottaJobStore.storeJobAndTrigger(TerracottaJobStore.java:513)
    5. org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:743)
    6. org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:243)
    6 frames
  3. ro.objects.quartz
    TerracottaQuartzBug.main
    1. ro.objects.quartz.test.TerracottaQuartzBug.main(TerracottaQuartzBug.java:38)
    1 frame