java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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.
    via by Vladimir Nicolici,
  • 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.
    via by Vladimir Nicolici,
    • 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)
    No Bugmate found.