3 Replies Latest reply on Mar 20, 2017 10:20 AM by Arul Prakash Veeramuthu

    NullPointerException with jBPM-Services + Spring

    Markus Uhr Newbie

      Hi

       

      I have set up a project where I instantiate the jBPM-Servies using Spring. I am following the documentation (Chapter 20. Integration) and the example project (GitHub - jBPM 6 spring application) closely. Everything deploys fine and I can execute processes. However, when I execute a process with a human task, I am unable to complete it. Upon calling UserTaskService.complete(...) I get the following exception:

       

      2016-02-09 14:45:00.848 WARN  [org.drools.persistence.SingleSessionCommandService] (EJB default - 2) Could not commit session: java.lang.NullPointerException
          at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)
          at org.drools.persistence.info.WorkItemInfo.getWorkItem(WorkItemInfo.java:116)
          at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalGetWorkItem(JPAWorkItemManager.java:213)
          at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:141)
          at org.drools.core.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:75)
          at org.drools.core.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:35)
          at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
          at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
          at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:584)
          at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
          at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:82)
          at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
          at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)
          at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:377)
          at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:152)
          at org.jbpm.services.task.wih.ExternalTaskEventListener.processTaskState(ExternalTaskEventListener.java:75)
          at org.jbpm.services.task.wih.ExternalTaskEventListener.afterTaskCompletedEvent(ExternalTaskEventListener.java:120)
          at org.jbpm.services.task.events.TaskEventSupport.fireAfterTaskCompleted(TaskEventSupport.java:226)
          at org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.taskOperation(MVELLifeCycleManager.java:387)
          at org.jbpm.services.task.impl.TaskInstanceServiceImpl.complete(TaskInstanceServiceImpl.java:186)
          at org.jbpm.services.task.commands.CompleteTaskCommand.execute(CompleteTaskCommand.java:76)
          at org.jbpm.services.task.commands.CompleteTaskCommand.execute(CompleteTaskCommand.java:39)
          at org.jbpm.services.task.commands.CompositeCommand.execute(CompositeCommand.java:146)
          at org.jbpm.services.task.commands.TaskCommandExecutorImpl$SelfExecutionCommandService.execute(TaskCommandExecutorImpl.java:65)
          at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
          at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:69)
          at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
          at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)
          at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
          at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:82)
          at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:40)
          at org.jbpm.services.task.impl.command.CommandBasedTaskService.complete(CommandBasedTaskService.java:173)
          at org.jbpm.kie.services.impl.UserTaskServiceImpl.complete(UserTaskServiceImpl.java:188)
          ...
      

       

      The reason is that the relevant WorkItemInfo does not get persisted properly; in particular, the column "workItemByteArray" in the table "WorkItemInfo" is null. It seems that TriggerUpdateTransactionSynchronization.beforeCompletion(...) is never called.

       

      Is this a bug or a config/setup problem?