JBoss Community

Human tasks : LocalTaskService JTA issue

created by Miloud Haimoune in jBPM - View the full discussion

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

Start a new discussion in jBPM at Community