Scenario:
- Start process engine with history cleanup with a defined batch window (creates history cleanup job)
- Stop process engine
- Configure process engine with history cleanup but without batch window
- Start up process engine (=> engine suspends cleanup job)
- Stop process engine
- Re-configure process engine. Add history cleanup batch window
- Start up process engine (=> engine reconfigures cleanup job)
Current behavior:
- Startup fails with NullPointerException (see stacktrace below)
Expected behavior:
- Startup succeeds, history cleanup job has new duedate according to the configured batch window
Reason:
- When reconfiguring the cleanup job, the logic expects a not-null due date, but this is not the case here
Stacktrace:
11-Apr-2018 12:42:26.436 SCHWERWIEGEND [main] org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: null java.lang.NullPointerException at java.util.Calendar.setTime(Calendar.java:1770) at org.camunda.bpm.engine.impl.jobexecutor.historycleanup.HistoryCleanupHelper.updateTime(HistoryCleanupHelper.java:116) at org.camunda.bpm.engine.impl.jobexecutor.historycleanup.HistoryCleanupHelper.isWithinBatchWindow(HistoryCleanupHelper.java:104) at org.camunda.bpm.engine.impl.jobexecutor.historycleanup.HistoryCleanupHelper.isWithinBatchWindow(HistoryCleanupHelper.java:97) at org.camunda.bpm.engine.impl.cmd.HistoryCleanupCmd.execute(HistoryCleanupCmd.java:81) at org.camunda.bpm.engine.impl.cmd.HistoryCleanupCmd.execute(HistoryCleanupCmd.java:33) at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104) at org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:58) at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66) at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) at org.camunda.bpm.engine.impl.HistoryServiceImpl.cleanUpHistoryAsync(HistoryServiceImpl.java:148) at org.camunda.bpm.engine.impl.HistoryServiceImpl.cleanUpHistoryAsync(HistoryServiceImpl.java:144) at org.camunda.bpm.engine.impl.BootstrapEngineCommand.createHistoryCleanupJob(BootstrapEngineCommand.java:44) at org.camunda.bpm.engine.impl.BootstrapEngineCommand.execute(BootstrapEngineCommand.java:37) at org.camunda.bpm.engine.impl.BootstrapEngineCommand.execute(BootstrapEngineCommand.java:27) at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104) at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) at org.camunda.bpm.engine.impl.ProcessEngineImpl.executeSchemaOperations(ProcessEngineImpl.java:116) at org.camunda.bpm.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:85) at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:724) at org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessEngineController.start(JmxManagedProcessEngineController.java:34) at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.startService(MBeanServiceContainer.java:73) at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.startService(MBeanServiceContainer.java:59) at org.camunda.bpm.container.impl.deployment.StartProcessEngineStep.performOperationStep(StartProcessEngineStep.java:112) at org.camunda.bpm.container.impl.spi.DeploymentOperation.execute(DeploymentOperation.java:116) at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.executeDeploymentOperation(MBeanServiceContainer.java:156) at org.camunda.bpm.container.impl.spi.DeploymentOperation$DeploymentOperationBuilder.execute(DeploymentOperation.java:212) at org.camunda.bpm.container.impl.tomcat.TomcatBpmPlatformBootstrap.deployBpmPlatform(TomcatBpmPlatformBootstrap.java:72) at org.camunda.bpm.container.impl.tomcat.TomcatBpmPlatformBootstrap.lifecycleEvent(TomcatBpmPlatformBootstrap.java:57) at <removed> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:388) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:333) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:782) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.startup.Catalina.start(Catalina.java:630) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485) 11-Apr-2018 12:42:26.437 SCHWERWIEGEND [main] org.apache.catalina.startup.Catalina.start The required Server component failed to start so Tomcat is unable to start. org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) at org.apache.catalina.startup.Catalina.start(Catalina.java:630) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485) Caused by: org.camunda.bpm.engine.ProcessEngineException: ENGINE-08043 Exception while performing 'deploy BPM platform' => 'Start process engine default': null at org.camunda.bpm.container.impl.ContainerIntegrationLogger.exceptionWhilePerformingOperationStep(ContainerIntegrationLogger.java:312) at org.camunda.bpm.container.impl.spi.DeploymentOperation.execute(DeploymentOperation.java:132) at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.executeDeploymentOperation(MBeanServiceContainer.java:156) at org.camunda.bpm.container.impl.spi.DeploymentOperation$DeploymentOperationBuilder.execute(DeploymentOperation.java:212) at org.camunda.bpm.container.impl.tomcat.TomcatBpmPlatformBootstrap.deployBpmPlatform(TomcatBpmPlatformBootstrap.java:72) at org.camunda.bpm.container.impl.tomcat.TomcatBpmPlatformBootstrap.lifecycleEvent(TomcatBpmPlatformBootstrap.java:57) at <removed> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:388) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:333) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:782) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 7 more Caused by: java.lang.NullPointerException at java.util.Calendar.setTime(Calendar.java:1770) at org.camunda.bpm.engine.impl.jobexecutor.historycleanup.HistoryCleanupHelper.updateTime(HistoryCleanupHelper.java:116) at org.camunda.bpm.engine.impl.jobexecutor.historycleanup.HistoryCleanupHelper.isWithinBatchWindow(HistoryCleanupHelper.java:104) at org.camunda.bpm.engine.impl.jobexecutor.historycleanup.HistoryCleanupHelper.isWithinBatchWindow(HistoryCleanupHelper.java:97) at org.camunda.bpm.engine.impl.cmd.HistoryCleanupCmd.execute(HistoryCleanupCmd.java:81) at org.camunda.bpm.engine.impl.cmd.HistoryCleanupCmd.execute(HistoryCleanupCmd.java:33) at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104) at org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:58) at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66) at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) at org.camunda.bpm.engine.impl.HistoryServiceImpl.cleanUpHistoryAsync(HistoryServiceImpl.java:148) at org.camunda.bpm.engine.impl.HistoryServiceImpl.cleanUpHistoryAsync(HistoryServiceImpl.java:144) at org.camunda.bpm.engine.impl.BootstrapEngineCommand.createHistoryCleanupJob(BootstrapEngineCommand.java:44) at org.camunda.bpm.engine.impl.BootstrapEngineCommand.execute(BootstrapEngineCommand.java:37) at org.camunda.bpm.engine.impl.BootstrapEngineCommand.execute(BootstrapEngineCommand.java:27) at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104) at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) at org.camunda.bpm.engine.impl.ProcessEngineImpl.executeSchemaOperations(ProcessEngineImpl.java:116) at org.camunda.bpm.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:85) at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:724) at org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessEngineController.start(JmxManagedProcessEngineController.java:34) at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.startService(MBeanServiceContainer.java:73) at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.startService(MBeanServiceContainer.java:59) at org.camunda.bpm.container.impl.deployment.StartProcessEngineStep.performOperationStep(StartProcessEngineStep.java:112) at org.camunda.bpm.container.impl.spi.DeploymentOperation.execute(DeploymentOperation.java:116) ... 18 more