1 Reply Latest reply on Jun 27, 2012 9:54 PM by gigazhang

    jbpm5.3 task complete NullPointerException GetCompletedTaskResponseHandler.execute(AsyncGenericHTWorkItemHandler.java:241)

    gigazhang Newbie

      the bpmn file:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <definitions id="Definition"

                   targetNamespace="http://www.jboss.org/drools"

                   typeLanguage="http://www.java.com/javaTypes"

                   expressionLanguage="http://www.mvel.org/2.0"

                   xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"

                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                   xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"

                   xmlns:g="http://www.jboss.org/drools/flow/gpd"

                   xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"

                   xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"

                   xmlns:di="http://www.omg.org/spec/DD/20100524/DI"

                   xmlns:tns="http://www.jboss.org/drools">

       

        <process processType="Private" isExecutable="true" id="com.baison.shop2" name="leave" tns:packageName="baison" >

       

          <!-- nodes -->

          <startEvent id="_1" name="Start" />

          <userTask id="_2" name="Order" >

            <ioSpecification>

              <dataInput id="_2_CommentInput" name="Comment" />

              <dataInput id="_2_TaskNameInput" name="TaskName" />

              <inputSet>

                <dataInputRefs>_2_CommentInput</dataInputRefs>

                <dataInputRefs>_2_TaskNameInput</dataInputRefs>

              </inputSet>

              <outputSet>

              </outputSet>

            </ioSpecification>

            <dataInputAssociation>

              <targetRef>_2_CommentInput</targetRef>

              <assignment>

                <from xsi:type="tFormalExpression">Order comment</from>

                <to xsi:type="tFormalExpression">_2_CommentInput</to>

              </assignment>

            </dataInputAssociation>

            <dataInputAssociation>

              <targetRef>_2_TaskNameInput</targetRef>

              <assignment>

                <from xsi:type="tFormalExpression">Order</from>

                <to xsi:type="tFormalExpression">_2_TaskNameInput</to>

              </assignment>

            </dataInputAssociation>

            <potentialOwner>

              <resourceAssignmentExpression>

                <formalExpression>chenjia</formalExpression>

              </resourceAssignmentExpression>

            </potentialOwner>

          </userTask>

          <userTask id="_3" name="Approval" >

            <ioSpecification>

              <dataInput id="_3_CommentInput" name="Comment" />

              <dataInput id="_3_TaskNameInput" name="TaskName" />

              <inputSet>

                <dataInputRefs>_3_CommentInput</dataInputRefs>

                <dataInputRefs>_3_TaskNameInput</dataInputRefs>

              </inputSet>

              <outputSet>

              </outputSet>

            </ioSpecification>

            <dataInputAssociation>

              <targetRef>_3_CommentInput</targetRef>

              <assignment>

                <from xsi:type="tFormalExpression">Approval comment</from>

                <to xsi:type="tFormalExpression">_3_CommentInput</to>

              </assignment>

            </dataInputAssociation>

            <dataInputAssociation>

              <targetRef>_3_TaskNameInput</targetRef>

              <assignment>

                <from xsi:type="tFormalExpression">Approval</from>

                <to xsi:type="tFormalExpression">_3_TaskNameInput</to>

              </assignment>

            </dataInputAssociation>

            <potentialOwner>

              <resourceAssignmentExpression>

                <formalExpression>zhangsan</formalExpression>

              </resourceAssignmentExpression>

            </potentialOwner>

          </userTask>

          <endEvent id="_4" name="End" >

              <terminateEventDefinition/>

          </endEvent>

       

          <!-- connections -->

          <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />

          <sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />

          <sequenceFlow id="_3-_4" sourceRef="_3" targetRef="_4" />

       

        </process>

       

        <bpmndi:BPMNDiagram>

          <bpmndi:BPMNPlane bpmnElement="com.baison.shop2" >

            <bpmndi:BPMNShape bpmnElement="_1" >

              <dc:Bounds x="100" y="100" width="48" height="48" />

            </bpmndi:BPMNShape>

            <bpmndi:BPMNShape bpmnElement="_2" >

              <dc:Bounds x="244" y="107" width="100" height="48" />

            </bpmndi:BPMNShape>

            <bpmndi:BPMNShape bpmnElement="_3" >

              <dc:Bounds x="421" y="108" width="100" height="48" />

            </bpmndi:BPMNShape>

            <bpmndi:BPMNShape bpmnElement="_4" >

              <dc:Bounds x="647" y="110" width="48" height="48" />

            </bpmndi:BPMNShape>

            <bpmndi:BPMNEdge bpmnElement="_1-_2" >

              <di:waypoint x="124" y="124" />

              <di:waypoint x="294" y="131" />

            </bpmndi:BPMNEdge>

            <bpmndi:BPMNEdge bpmnElement="_2-_3" >

              <di:waypoint x="294" y="131" />

              <di:waypoint x="471" y="132" />

            </bpmndi:BPMNEdge>

            <bpmndi:BPMNEdge bpmnElement="_3-_4" >

              <di:waypoint x="471" y="132" />

              <di:waypoint x="671" y="134" />

            </bpmndi:BPMNEdge>

          </bpmndi:BPMNPlane>

        </bpmndi:BPMNDiagram>

       

      </definitions>

       

      822_20120627172050.png

       

       

      ContentData contentData = null;

              if (data != null) {

                  ByteArrayOutputStream bos = new ByteArrayOutputStream();

                  ObjectOutputStream out = null;

                  try {

                      out = new ObjectOutputStream(bos);

                      out.writeObject(data);

                      contentData = new ContentData();

                      System.out.println(bos.toByteArray());

                      contentData.setContent(bos.toByteArray());

                      contentData.setAccessType(AccessType.Inline);

                      out.close();

                      out = null;

                      bos.close();

                      bos = null;

                  } catch (IOException e) {

                      e.printStackTrace();

                  }

              }

              taskClient.complete(taskId, userId, contentData, operationHandler);

       

       

      when I complete the task,there throws exception:

       

       

      2012-06-27 17:34:46,634 INFO [org.apache.mina.filter.logging.LoggingFilter] - <SENT: HeapBuffer[pos=0 lim=0 cap=0: empty]>

      java.lang.NullPointerException

          at org.jbpm.process.workitem.wsht.AsyncGenericHTWorkItemHandler$GetCompletedTaskResponseHandler.execute(AsyncGenericHTWorkItemHandler.java:241)

          at org.jbpm.task.service.TaskClientHandler.messageReceived(TaskClientHandler.java:81)

          at org.jbpm.task.service.mina.MinaTaskClientHandler.messageReceived(MinaTaskClientHandler.java:47)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

          at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:427)

          at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:245)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

          at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:692)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:645)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:634)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:66)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1078)

          at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

          at java.lang.Thread.run(Thread.java:722)