JBoss Community

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

created by gigazhang in jBPM Development - View the full discussion

https://community.jboss.org/servlet/JiveServlet/downloadImage/2-744483-18877/450-191/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)

Reply to this message by going to Community

Start a new discussion in jBPM Development at Community