No active JTA transaction on joinTransaction call

1,602 views
Skip to first unread message

Fardad Moosae

unread,
Apr 14, 2015, 3:31:20 AM4/14/15
to jbpm-dev...@googlegroups.com
Dear All,

I am running the jBPM  sample example named as "Request" in eclipse. I am using persistence and transaction.. But when I start the process instance, the list of tasks appear in the task lists form.. but when I click the button "Complete" , following error
appears:

Apr 13, 2015 5:14:42 PM org.hibernate.ejb.
AbstractEntityManagerImpl joinTransaction
WARN: HHH000326: Cannot join transaction: do not override hibernate.transaction.factory_class
Exception in thread "AWT-EventQueue-0" javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
    at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1233)
    at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1183)
    at org.drools.persistence.jpa.AbstractPersistenceContextManager.getCommandScopedEntityManager(AbstractPersistenceContextManager.java:110)
    at org.drools.persistence.jpa.JpaPersistenceContextManager.getCommandScopedPersistenceContext(JpaPersistenceContextManager.java:65)
    at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:110)
    at com.sample.UIWorkItemHandler.complete(UIWorkItemHandler.java:201)
    at com.sample.UIWorkItemHandlerDialog.complete(UIWorkItemHandlerDialog.java:166)
    at com.sample.UIWorkItemHandlerDialog.access$1(UIWorkItemHandlerDialog.java:164)
    at com.sample.UIWorkItemHandlerDialog$2.actionPerformed(UIWorkItemHandlerDialog.java:114)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)


I face this problem when i want to use a task form for the tasks and call the complete function of WorkItemHandler by using swing button action listener as follows:

selectButton.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent event)
            {
                select();
            }
        });

private void select()
    {
        WorkItem workItem = getSelectedWorkItem();
        if (workItem != null)
        {
            UIWorkItemHandlerDialog dialog = new UIWorkItemHandlerDialog(UIWorkItemHandler.this, workItem);
            dialog.setVisible(true);
        }
    }

completeButton.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent event)
            {
                complete();
            }
        });
private void complete()
    {
        handler.complete(workItem, results);
        dispose();
    }


Could anyone help me ?
error.png

Maciej Swiderski

unread,
Apr 14, 2015, 1:02:46 PM4/14/15
to Fardad Moosae, jbpm-dev...@googlegroups.com
without complete view into source code can’t say for sure but most likely you use cached work item manager to complete the work item, while you should always take it form ksession when performing the operations. This is because work item manager operations are scoped in transaction and thus will not be available when transaction completes.

Maciej
--
You received this message because you are subscribed to the Google Groups "jBPM Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-developme...@googlegroups.com.
To post to this group, send email to jbpm-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-development/a38ac245-14ec-49f1-ad50-2e660216039c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<error.png>

Reply all
Reply to author
Forward
0 new messages