Hi,
We are using QuartDeadlineManager (Axon 4.5.11).
In our code we call cancelAllWithinScope()
. During replay of some event handlers jobDetail
can be null thus jobDetail.getJobdataMap()
throws a NullPointerException.
@Override
public void cancelAllWithinScope(String deadlineName, ScopeDescriptor scope) {
try {
Set<JobKey> jobKeys = scheduler.getJobKeys(GroupMatcher.jobGroupEquals(deadlineName));
for (JobKey jobKey : jobKeys) {
JobDetail jobDetail = scheduler.getJobDetail(jobKey);
ScopeDescriptor jobScope = DeadlineJob.DeadlineJobDataBinder
.deadlineScope(serializer, jobDetail.getJobDataMap());
if (scope.equals(jobScope)) {
cancelSchedule(jobKey);
}
}
} catch (SchedulerException e) {
throw new DeadlineException("An error occurred while cancelling a timer for a deadline manager", e);
}
}
I haven’t figured out how/why exactly.
Or should the code have a null check in there? Any ideas?