Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-4852

TaskService.complete() throws NullPointerException without a meaningful message when a RuntimeManager with the deploymentId is not registered

    Details

      Description

      When a Task is created, RuntimeManager's identifier is persisted as Task's deploymentId. Later on, when TaskService.complete() is called, ExternalTaskEventListener picks up the RuntimeManager from RuntimeManagerRegistry using the Task's deploymentId as a key. If the RuntimeManager is not registered in RuntimeManagerRegistry at that time (for example, after reboot), it fails with NullPointerException. It's okay to fail but it's better to have a meaningful error message.

      2015-11-27 14:34:02,139 [main] [org.jbpm.services.task.persistence.TaskTransactionInterceptor] WARN  Could not commit session
      java.lang.NullPointerException: null
      	at org.jbpm.services.task.wih.ExternalTaskEventListener.afterTaskCompletedEvent(ExternalTaskEventListener.java:116) ~[jbpm-human-task-workitems-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.jbpm.services.task.events.TaskEventSupport.fireAfterTaskCompleted(TaskEventSupport.java:251) ~[jbpm-human-task-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.taskOperation(MVELLifeCycleManager.java:386) ~[jbpm-human-task-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.jbpm.services.task.impl.TaskInstanceServiceImpl.complete(TaskInstanceServiceImpl.java:188) ~[jbpm-human-task-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.jbpm.services.task.commands.CompleteTaskCommand.execute(CompleteTaskCommand.java:76) ~[jbpm-human-task-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.jbpm.services.task.commands.CompleteTaskCommand.execute(CompleteTaskCommand.java:39) ~[jbpm-human-task-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.jbpm.services.task.commands.CompositeCommand.execute(CompositeCommand.java:146) ~[jbpm-human-task-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.jbpm.services.task.commands.TaskCommandExecutorImpl$SelfExecutionCommandService.execute(TaskCommandExecutorImpl.java:65) ~[jbpm-human-task-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) [drools-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:69) ~[jbpm-human-task-jpa-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) [drools-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73) [drools-persistence-jpa-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) [drools-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:82) [drools-persistence-jpa-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:40) [jbpm-human-task-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.jbpm.services.task.impl.command.CommandBasedTaskService.complete(CommandBasedTaskService.java:174) [jbpm-human-task-core-6.4.0-SNAPSHOT.jar:6.4.0-SNAPSHOT]
      	at org.jbpm.runtime.manager.impl.PerRequestRuntimeManagerTest.testNonexistentDeploymentId(PerRequestRuntimeManagerTest.java:509) [test-classes/:na]
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swiderski.maciej Maciej Swiderski
                Reporter:
                tkobayashi Toshiya Kobayashi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: