[jboss-user] [jBPM] - Human tasks : LocalTaskService JTA issue

Miloud Haimoune do-not-reply at jboss.com
Thu Jun 21 08:05:12 EDT 2012


Miloud Haimoune [https://community.jboss.org/people/milhaim] created the discussion

"Human tasks : LocalTaskService JTA issue"

To view the discussion, visit: https://community.jboss.org/message/743349#743349

--------------------------------------------------------------
Hi all,

I'm Using JBPM5.2.final in a seam 2 application all running under jboss 5.1 SA.

When a use LocalTaskService as following : 
to connect the service : 

public void connect() {
            if (service == null) {
                org.jbpm.task.service.TaskService taskService = HumanTaskService.getService();                
                service = new LocalTaskService(taskService.createSession());
            }
....


and I register the human task :

           TaskService taskService = HumanTaskService.getService();     
            SyncWSHumanTaskHandler handler = new SyncWSHumanTaskHandler(new LocalTaskService(taskService.createSession()), ksession);   
            ksession.getWorkItemManager().registerWorkItemHandler("Human Task", handler);


But when a start my process instance and create a human task I get then the following exception (*A JTA EntityManager cannot use getTransaction()*) : 
I'm using jboss transaction manager

12:33:59,014 ERROR [STDERR] Caused by: java.lang.IllegalStateException: A JTA EntityManager cannot use getTransaction()
12:33:59,014 ERROR [STDERR]     at org.hibernate.ejb.AbstractEntityManagerImpl.getTransaction(AbstractEntityManagerImpl.java:324)
12:33:59,014 ERROR [STDERR]     at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:442)
12:33:59,014 ERROR [STDERR]     at org.jbpm.task.service.local.LocalTaskService.start(LocalTaskService.java:224)
12:33:59,014 ERROR [STDERR]     at com.atriumnetwork.jbpm.LocalTaskManager.completeTask(LocalTaskManager.java:96)


I checked in the sources ther were tow options for TransactionType: default and local-JTA

So I tried to set the transaction type to local-JTA :

taskSession.setTransactionType("local-JTA");


This is working when I start my process  but  when  execution other human tasks I get : *No active JTA transaction on joinTransaction call exception*
*
*
Caused by: java.lang.RuntimeException: javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
    at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:990)
    at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:433)
    at org.jbpm.task.service.local.LocalTaskService.skip(LocalTaskService.java:220)
    at org.jbpm.process.workitem.wsht.SyncWSHumanTaskHandler.abortWorkItem(SyncWSHumanTaskHandler.java:256)
    at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalAbortWorkItem(JPAWorkItemManager.java:76)
    at org.jbpm.workflow.instance.node.WorkItemNodeInstance.cancel(WorkItemNodeInstance.java:249)
    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.setState(WorkflowProcessInstanceImpl.java:257)
    at org.jbpm.workflow.instance.node.EndNodeInstance.internalTrigger(EndNodeInstance.java:57)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:122)


is there another option for the transaction type ??  

any help will be very appreciated
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/743349#743349]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120621/14e6a6ff/attachment-0001.html 


More information about the jboss-user mailing list