1
votes

I encounter the error below but only after my application crashes because of an other error. So, I suppose these errors are linked. But the first is very strange :

Caused by: org.jbpm.task.service.PermissionDeniedException: User '[User:'renauds']' was unable to execution operation 'Resume' on task id 7 due to a no 'current status' match at org.jbpm.task.service.TaskServiceSession.evalCommand(TaskServiceSession.java:311) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:426) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.task.service.local.LocalTaskService.resume(LocalTaskService.java:264) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at com.st.ams.task.management.TaskManager.resumeTask(TaskManager.java:320) [classes:]

After crash, all is fine and the resume process is available and can go until the end. But all other new process crash. I try redeploy the application, restart the server, change isolation level and so on but nothing works. The only solution is to remove all tables and rebuild the database and all processes works again.

This is the stack trace of the error blocking me :

17:02:09,370 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 17:02:09,370 INFO [stdout] (http--127.0.0.1-8080-5) insert 17:02:09,371 INFO [stdout] (http--127.0.0.1-8080-5) into 17:02:09,371 INFO [stdout] (http--127.0.0.1-8080-5)
PeopleAssignments_PotOwners 17:02:09,371 INFO [stdout] (http--127.0.0.1-8080-5) (task_id, entity_id) 17:02:09,371 INFO [stdout] (http--127.0.0.1-8080-5) values 17:02:09,372 INFO [stdout] (http--127.0.0.1-8080-5) (?, ?)

17:02:09,380 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--127.0.0.1-8080-5) SQL Error: 1452, SQLState: 23000 17:02:09,380 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--127.0.0.1-8080-5) Cannot add or update a child row: a foreign key constraint fails (jbpm_test.peopleassignments_potowners, CONSTRAINT FK1EE418D2C122ED2 FOREIGN KEY (entity_id) REFERENCES organizationalentity (id) ON DELETE NO ACTION ON UPDATE CASCADE) 17:02:09,383 WARN [com.arjuna.ats.arjuna] (http--127.0.0.1-8080-5) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffff0a838a14:-384e4b5d:516820a6:25d, org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@14db649

: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (jbpm_test.peopleassignments_potowners, CONSTRAINT FK1EE418D2C122ED2 FOREIGN KEY (entity_id) REFERENCES organizationalentity (id) ON DELETE NO ACTION ON UPDATE CASCADE) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1295) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1481) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:109) [hibernate-core-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.0.1.Final.jar:4.0.1.Final] at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93) at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165) at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117) at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75) at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:167) at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final] at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:376) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final] at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.abortWorkItem(CommandBasedStatefulKnowledgeSession.java:156) [drools-core-5.5.0.Final.jar:5.5.0.Final] at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.handleCompletedTask(GenericHTWorkItemHandler.java:276) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.execute(GenericHTWorkItemHandler.java:234) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.task.service.local.LocalTaskService$SimpleEventTransport.trigger(LocalTaskService.java:329) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.task.event.MessagingTaskEventListener.triggerPayload(MessagingTaskEventListener.java:76) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.task.event.MessagingTaskEventListener.handleEvent(MessagingTaskEventListener.java:92) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.task.event.MessagingTaskEventListener.taskCompleted(MessagingTaskEventListener.java:109) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.task.event.TaskEventSupport.fireTaskCompleted(TaskEventSupport.java:49) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.task.service.TaskServiceSession.postTaskCompleteOperation(TaskServiceSession.java:569) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:495) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.task.service.local.LocalTaskService.complete(LocalTaskService.java:83) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at org.jbpm.task.service.local.LocalTaskService.completeWithResults(LocalTaskService.java:91) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final] at com.st.ams.task.management.TaskManager.completeTask(TaskManager.java:295) [classes:]

Is it possible that jbpm lock a table outside a transaction??

1

1 Answers

0
votes

The first exception is caused by the fact that you are trying to perform on operation on a task that is not allowed in its current state. In this specific case, I assume you're trying to resume a task that is not suspended. You would get a similar exception for example if you would try to complete a task which is not in progress.

The second exception seems to be caused by a potential owner for a task not being known. Either add all potential users to the task service upfront or use a user-group callback to manage it dynamically.

Looking at your stack trace, I did notice one strange thing:

org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.abortWorkItem(CommandBasedStatefulKnowledgeSession.java:156) [drools-core-5.5.0.Final.jar:5.5.0.Final] at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.handleCompletedTask(GenericHTWorkItemHandler.java:276)

It seems your work item is aborted instead of completed (which seems to be what your doing to your task), because the engine cannot find the task (that you just completed) in state completed. I'm not sure what might be causing this, but it seems that that handler is not running in the same transaction as the one that is completing the task.

I would recommend making sure that there are no other older ksessions, task services and/or handlers still active that are no longer being used, so make sure you do dispose your ksession, task service and handlers if they are no longer needed. Could you try only creating one local task service session per task service?.

Kris