Hey andrejs (cc thorben.lindhauer),
I investigated a bit and I think I have a good understanding of what is causing the issue for you.
In the example code you shared, you are creating a custom ProcessEngineConfiguration. Note, that the SpringProcessEngineConfiguration creates a new DefaultJobExecutor (see) which is not provided as Spring Boot Bean. Since there is no JobExecutor available as Spring Boot Bean, a SpringJobExecutor is created. However, the process engine is not registered for this JobExecutor causing the NPE during the health check.
This issue does not occur when using the default process engine configuration. If you want to provide your own, you should also make sure to register all process engine plugins like it is done in the default case. One of the plugins is the DefaultJobConfiguration which provides the JobExecutor Bean.
When I change your code to something like the following all process engine plugins are registered and the JobExecutor is provided as Bean:
@Bean
public SpringProcessEngineConfiguration engineConfiguration(List<ProcessEnginePlugin> processEnginePlugins, DataSource dataSource,
PlatformTransactionManager transactionManager) {
SpringProcessEngineConfiguration configuration = new SpringProcessEngineConfiguration();
configuration.setDataSource(dataSource);
configuration.setTransactionManager(transactionManager);
configuration.setJobExecutorActivate(true);
configuration.setDatabaseSchemaUpdate("true");
configuration.getProcessEnginePlugins().add(new CompositeProcessEnginePlugin(processEnginePlugins));
return configuration;
}
That said, I would not consider this a bug anymore. I would agree though, that the NPE should be avoided. Maybe by making sure that only one JobExecutor can be created.
andrejs,
Thanks for raising this bug report. I was able to reproduce the bug via this test. I will investigate further.
Cheers,
Miklas