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

Terracotta | d2x | 7 years ago
  1. 0

    ObjectAlreadyExistsException and reschedule

    Terracotta | 7 years ago | d2x
    org.quartz.ObjectAlreadyExistsException: Unable to store Trigger with name: '7079DB2AA8C1411AE0400D0A9F1E4A24' and group: 'SMS', because one already exists with this identification.
  2. 0

    multiple imap rivers with multiple indexes

    GitHub | 2 years ago | wilsotc
    org.quartz.ObjectAlreadyExistsException: Unable to store Trigger with name: 'intervaltrigger' and group: 'group1', because one already exists with this identification.
  3. 0

    Error scheduling job for server ... org.quartz.ObjectAlreadyExistsException

    GitHub | 5 years ago | fdrouet
    org.quartz.ObjectAlreadyExistsException: Unable to store Trigger with name: 'xxxxxxxx.org:32001-1331029689802' and group: 'DEFAULT', because one already exists with this identification.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 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.

    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: '7079DB2AA8C1411AE0400D0A9F1E4A24' and group: 'SMS', because one already exists with this identification.

      at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger()
    2. quartz
      StdScheduler.rescheduleJob
      1. org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1176)[quartz-1.6.5.jar:1.6.5]
      2. org.quartz.impl.jdbcjobstore.JobStoreSupport.replaceTrigger(JobStoreSupport.java:1511)[quartz-1.6.5.jar:1.6.5]
      3. org.quartz.impl.jdbcjobstore.JobStoreSupport$9.execute(JobStoreSupport.java:1485)[quartz-1.6.5.jar:1.6.5]
      4. org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:244)[quartz-1.6.5.jar:1.6.5]
      5. org.quartz.impl.jdbcjobstore.JobStoreSupport.replaceTrigger(JobStoreSupport.java:1481)[quartz-1.6.5.jar:1.6.5]
      6. org.quartz.core.QuartzScheduler.rescheduleJob(QuartzScheduler.java:903)[quartz-1.6.5.jar:1.6.5]
      7. org.quartz.impl.StdScheduler.rescheduleJob(StdScheduler.java:324)[quartz-1.6.5.jar:1.6.5]
      7 frames