JobExecutorHealthIndicator - Health check failed.java.lang.NullPointerException: null

I was getting below error in camunda-spring-boot server setup. How to fix the below issue?

2019-11-16 05:26:00 [http-nio-8081-exec-3] [] [] WARN  o.c.b.s.b.s.a.JobExecutorHealthIndicator - Health check failed
java.lang.NullPointerException: null
        at java.util.HashSet.<init>(HashSet.java:118)
        at org.camunda.bpm.spring.boot.starter.actuator.JobExecutorHealthIndicator$Details.<init>(JobExecutorHealthIndicator.java:65)
        at org.camunda.bpm.spring.boot.starter.actuator.JobExecutorHealthIndicator$Details.<init>(JobExecutorHealthIndicator.java:49)
        at org.camunda.bpm.spring.boot.starter.actuator.JobExecutorHealthIndicator$Details$DetailsBuilder.build(JobExecutorHealthIndicator.java:147)
        at org.camunda.bpm.spring.boot.starter.actuator.JobExecutorHealthIndicator$Details.from(JobExecutorHealthIndicator.java:84)
        at org.camunda.bpm.spring.boot.starter.actuator.JobExecutorHealthIndicator$Details.access$000(JobExecutorHealthIndicator.java:49)
        at org.camunda.bpm.spring.boot.starter.actuator.JobExecutorHealthIndicator.doHealthCheck(JobExecutorHealthIndicator.java:46)
        at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:84)
        at org.springframework.boot.actuate.health.CompositeHealthIndicator.health(CompositeHealthIndicator.java:98)
        at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:50)
        at org.springframework.boot.actuate.health.HealthEndpointWebExtension.health(HealthEndpointWebExtension.java:54)
        at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282)
        at org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker.invoke(ReflectiveOperationInvoker.java:76)
        at org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation.invoke(AbstractDiscoveredOperation.java:61)

To avoid the above exception i have disabled the JobExecutorHealthIndicator by adding below property in bootstrap.yml

management:
  health:
    camunda:
      enabled: false

Do you have any idea what configuration is missing? How can i fix this problem not disabling health check?

Had the same issue and the cause was that CamundaBpmActuatorConfiguration gets injected with SpringJobExecutor instead of the default JobExecutor.

The fix was to provide a @Bean(name = “jobExecutor”) that returns the default JobExecutor.

2 Likes

Where exactly did you provide this @Bean? Thanks

@Bean(name = “jobExecutor”)
public SpringJobExecutor jobExecutor() {
SpringJobExecutor jobExecutor = new SpringJobExecutor();
jobExecutor.registerProcessEngine((ProcessEngineImpl) processEngine);
return jobExecutor;
}