setTaskIdGenerator(new DbIdGenerator()) with H2 causes NPE
See original GitHub issueHI, I was trying to set id generator for engine configuration as suggested in Upgrade notes in 6.3.1 blog post, but code mentioned there doesn’t set the generator for task ids. When I tried to set it like this:
@Bean
public EngineConfigurationConfigurer<SpringProcessEngineConfiguration> processEngineDbIdGeneratorConfigurer() {
return engineConfiguration -> engineConfiguration
.setTaskIdGenerator(new DbIdGenerator());
}
and with H2 being used as db it throws NPE:
2018-07-04T08:04:36.763Z ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet] [traceId:,parentId:,spanId:] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException: null
at org.flowable.engine.impl.db.DbIdGenerator.getNewBlock(DbIdGenerator.java:44) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.db.DbIdGenerator.getNextId(DbIdGenerator.java:37) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.task.service.impl.persistence.entity.TaskEntityManagerImpl.insert(TaskEntityManagerImpl.java:207) ~[flowable-task-service-6.3.1.jar:6.3.1]
at org.flowable.task.service.impl.persistence.entity.TaskEntityManagerImpl.insert(TaskEntityManagerImpl.java:38) ~[flowable-task-service-6.3.1.jar:6.3.1]
at org.flowable.task.service.impl.TaskServiceImpl.insertTask(TaskServiceImpl.java:98) ~[flowable-task-service-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.util.TaskHelper.insertTask(TaskHelper.java:174) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.util.TaskHelper.insertTask(TaskHelper.java:149) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.bpmn.behavior.UserTaskActivityBehavior.execute(UserTaskActivityBehavior.java:220) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeActivityBehavior(ContinueProcessOperation.java:258) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeSynchronous(ContinueProcessOperation.java:155) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughFlowNode(ContinueProcessOperation.java:112) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughSequenceFlow(ContinueProcessOperation.java:305) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.agenda.ContinueProcessOperation.run(ContinueProcessOperation.java:78) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:88) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:72) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:56) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:25) ~[flowable-engine-6.3.1.jar:6.3.1]
at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53) ~[flowable-engine-common-6.3.1.jar:6.3.1]
at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:71) ~[flowable-engine-common-6.3.1.jar:6.3.1]
at org.flowable.idm.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:49) ~[flowable-idm-spring-6.3.1.jar:6.3.1]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.flowable.idm.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:46) ~[flowable-idm-spring-6.3.1.jar:6.3.1]
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) ~[flowable-engine-common-6.3.1.jar:6.3.1]
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56) ~[flowable-engine-common-6.3.1.jar:6.3.1]
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51) ~[flowable-engine-common-6.3.1.jar:6.3.1]
at org.flowable.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:105) ~[flowable-engine-6.3.1.jar:6.3.1]
...
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
java - What is a NullPointerException, and how do I fix it?
The NullPointerException (NPE) typically occurs when you declare a variable but did not create an object and assign it to the variable before...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the reproducal @jyyna. We will have a look into it and try to figure out why that is happening.
Hi Martin, yes, with changes in your PR it works. Thanks Martin