Bug 832954

Summary: Unable to begin transaction in JBPM running on WAS-8.0+DB2-9.7
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: kashi <kkumbhar>
Component: jBPM 5Assignee: Kris Verlaenen <kverlaen>
Status: NEW --- QA Contact:
Severity: urgent Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.0.GA   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
error log
none
my bpmn
none
maven project - the reproducer none

Description kashi 2012-06-18 09:24:57 UTC
Created attachment 592569 [details]
error log

Description of problem:
Exception in thread "Thread-192" java.lang.RuntimeException: Unable to begin transaction and giving NPE
We have a simple process with start->First HT ->Second HT->end   and the localtaskservice has been used to call human tasks.
The process starts using api and first HT completes, howver at the end of the complete method it gives a nullpointer exception as attached.



Version-Release number of selected component (if applicable):
5.3-ER8

How reproducible:
1.Create the sample two HT process
2.create a ear file and ejb to process the jbpm methods like start 3.process,claim and complete task etc.
4.call ejb from servlets.
5.Deploy application on websphere using XA Db2 datasource.

  
Actual results:
It gives a error when NPE when it completes the first human task.

Expected results:
The process should execute bot the tasks and complete the process.

Additional info:

Comment 1 Zuzana Krejčová 2012-06-18 13:00:13 UTC
Could you please describe your process, perhaps attach it? It would help to know such things as - are those tasks skippable, are they assigned to a user, multiple users, or a group, what are the task names?

Comment 2 kashi 2012-06-18 13:02:31 UTC
Created attachment 592637 [details]
my bpmn

Comment 3 kashi 2012-06-19 05:53:17 UTC
Thes task is assigned to a user group and attached is the BPMN process.

The early solution on this would be appreciated.

Comment 4 kashi 2012-06-19 14:21:04 UTC
Hi All,
       When we added below change in our complete task in jbpm5 as below we are able to complete the process. The main change is 		workItemHandler.setLocal( true ); without it was calling some runnable thread and timeout.


	SyncWSHumanTaskHandler workItemHandler = new SyncWSHumanTaskHandler( taskService, session );
		workItemHandler.setLocal( true );
		workItemHandler.connect();
		session.getWorkItemManager().registerWorkItemHandler( "Human Task", workItemHandler );




In jbpm core , im not sure what the line does in runnable:-
SyncWSHumanTaskHandler

 

private class TaskCompletedHandler extends AbstractBaseResponseHandler implements EventResponseHandler {

       

        public void execute(Payload payload) {

            TaskEvent event = ( TaskEvent ) payload.get();

            final long taskId = event.getTaskId();

            if (local) {

                  handleCompletedTask(taskId);

            } else {

                  Runnable runnable = new Runnable() {

                        public void run() {

                              handleCompletedTask(taskId);

                        }

                  };

                  new Thread(runnable).start();

            }

        }
     
        public boolean isRemove() {

            return false;

        }

Comment 5 kashi 2012-06-19 14:22:11 UTC
Kindly can any one comment what could be the right approach for workItemHandler.setLocal( true );


secondly in WAS the EJB should be BMT.

Comment 6 Radovan Synek 2012-06-27 07:56:44 UTC
Created attachment 594708 [details]
maven project - the reproducer

Builds an .ear archive; deploy it on WAS (after small change in ProcessLauncher can be deployed on JBoss too). The web page shows whether the process was completed or not. For detailed information see the server log.

Comment 7 Radovan Synek 2012-06-27 08:07:01 UTC
As kashi stated, the problem is caused by handling the completed task in a new thread inside SyncWSHumanTaskHandler.TaskCompletedHandler, which can be disabled by setting the local flag: workItemHandler.setLocal(true);

On WAS, there is the described exception, deployed on JBoss the example behaves differently: process stays in the second task node because the task entity has not been written to the database yet and so there is no task to complete.