Nullpointer exception with Task executor at the end of Timer duration

Hello,

We are using Camunda(7.19.0) with Spring boot (2.7.6) and are using the Embedded approach of Camunda.
SpringProcessEngine (adding only the properties which are needed for this issue):
JobExecutorActivate - true to process engine

and

@Bean("jobExecutor")
public SpringJobExecutor jobExecutor() throws Exception {
  SpringJobExecutor jobExecutor = new SpringJobExecutor();
  jobExecutor.setMaxJobsPerAcquisition(10);
  return jobExecutor;
}

@Bean("taskExecutor")
public TaskExecutor camundaTaskExecutor() {
  final ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
  threadPoolTaskExecutor.setCorePoolSize(5);
  threadPoolTaskExecutor.setMaxPoolSize(20);
  threadPoolTaskExecutor.setKeepAliveSeconds(5);
  threadPoolTaskExecutor.setQueueCapacity(10);
  return threadPoolTaskExecutor;
}

In our model, we have a timer with the duration of 3 minutes. At the end of the timer duration, we are getting the following error (but not consistently).

2023-06-26 15:56:46.289 DEBUG 22016 --- [ingJobExecutor]] org.camunda.bpm.engine.cmd               : ENGINE-13006 Finishing command -------------------- AcquireJobsCmd ----------------------
2023-06-26 15:56:46.289 DEBUG 22016 --- [ingJobExecutor]] org.camunda.bpm.engine.jobexecutor       : ENGINE-14022 Acquired 1 jobs for process engine 'default': [[**4858**]]
2023-06-26 15:56:46.289 DEBUG 22016 --- [ingJobExecutor]] org.camunda.bpm.engine.jobexecutor       : ENGINE-14023 Execute jobs for process engine 'default': [**4858**]
2023-06-26 15:56:46.289 ERROR 22016 --- [ingJobExecutor]] org.camunda.bpm.engine.jobexecutor       : ENGINE-14019 Exception during job acquisition Cannot invoke "org.springframework.core.task.TaskExecutor.execute(java.lang.Runnable)" because "this.taskExecutor" is null

java.lang.NullPointerException: Cannot invoke "org.springframework.core.task.TaskExecutor.execute(java.lang.Runnable)" because "this.taskExecutor" is null
	at org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor.executeJobs(SpringJobExecutor.java:59)
	at org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable.executeJobs(SequentialJobAcquisitionRunnable.java:147)
	at org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable.run(SequentialJobAcquisitionRunnable.java:81)
	at java.base/java.lang.Thread.run(Thread.java:833)

2023-06-26 15:56:46.289 DEBUG 22016 --- [ingJobExecutor]] org.camunda.bpm.engine.jobexecutor       : ENGINE-14011 Job acquisition thread sleeping for 59996 millis
2023-06-26 15:57:09.889 DEBUG 22016 --- [ultJobExecutor]] org.camunda.bpm.engine.jobexecutor       : ENGINE-14012 Job acquisition thread woke up

And if we look at ACT_RU_JOB table, we see that there is a record existing for this id ‘4858’.

image

Every time after the Null Pointer Exception was thrown on the Task Executor, the value in the column ‘REV_’ increases by 1 and also the value in the column ‘LOCK_EXP_TIME_’ increases by 5 minutes. The retrial is triggered after every 5 minutes. After multiple retrials, the execution proceeds and the record is then removed from the entity.

We are unsure of the cause behind this exception and its resolution.