<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Could not commit session: java.lang.NullPointerException after start process, start task and complete task in one method
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/franco80">franco80</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/787295#787295">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hello all,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>(Jbpm 5.3, JPA2, Jboss 7.1.1)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span id="result_box" lang="en"><span class="hps">sometimes</span> <span class="hps">I get</span> <span class="hps">an exception</span> <span class="hps">when create a</span> <span class="hps">process,</span> <span class="hps">start</span> <span class="hps">a task</span>, <span class="hps">and the</span> <span class="hps">task is completed</span>. <span class="hps"></span></span><span id="result_box" lang="en"><span class="hps">The whole</span> <span class="hps">is carried out</span> <span class="hps">in a single</span> <span class="hps">method.</span></span><span id="result_box" lang="en"><span class="hps"> Any ideas what is wrong  ?</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Code with null pointer:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>               public Process getProcess() {</p><p>                       if (this.process == null) {</p><p>line 67 -->                this.process = kruntime.getKnowledgeBase().getProcess(processId);</p><p>                       }</p><p>                       return this.process;</p><p>              }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:22,889 ERROR [org.drools.persistence.SingleSessionCommandService] (NioProcessor-4) Could not commit session: java.lang.NullPointerException</p><p>    at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:67) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getWorkflowProcess(WorkflowProcessInstanceImpl.java:181) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getNodeContainer(WorkflowProcessInstanceImpl.java:69) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.getNode(NodeInstanceImpl.java:101) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.resolveContext(NodeInstanceImpl.java:217) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.resolveContextInstance(NodeInstanceImpl.java:221) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.workflow.instance.node.WorkItemNodeInstance.triggerCompleted(WorkItemNodeInstance.java:206) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.workflow.instance.node.HumanTaskNodeInstance.triggerCompleted(HumanTaskNodeInstance.java:90) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.workflow.instance.node.WorkItemNodeInstance.workItemCompleted(WorkItemNodeInstance.java:301) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.workflow.instance.node.WorkItemNodeInstance.signalEvent(WorkItemNodeInstance.java:277) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:326) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:121) [drools-persistence-jpa-5.4.0.Final.jar:5.4.0.Final]</p><p>    at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:69) [drools-core-5.4.0.Final.jar:5.4.0.Final]</p><p>    at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:32) [drools-core-5.4.0.Final.jar:5.4.0.Final]</p><p>    at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36) [drools-core-5.4.0.Final.jar:5.4.0.Final]</p><p>    at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:367) [drools-persistence-jpa-5.4.0.Final.jar:5.4.0.Final]</p><p>    at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:150) [drools-core-5.4.0.Final.jar:5.4.0.Final]</p><p>    at org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler$GetResultContentResponseHandler.execute(CommandBasedWSHumanTaskHandler.java:364) [jbpm-human-task-mina-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.task.service.TaskClientHandler.messageReceived(TaskClientHandler.java:153) [jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.jbpm.task.service.mina.MinaTaskClientHandler.messageReceived(MinaTaskClientHandler.java:47) [jbpm-human-task-mina-5.3.0.Final.jar:5.3.0.Final]</p><p>    at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969) [mina-core-2.0.0-RC1.jar:]</p><p>    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.0.0-RC1.jar:]</p><p>    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09]</p><p>    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09]</p><p>    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,254 ERROR [stderr] (NioProcessor-4) java.lang.NullPointerException</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,255 ERROR [stderr] (NioProcessor-4)     at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:67)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,256 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getWorkflowProcess(WorkflowProcessInstanceImpl.java:181)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,257 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getNodeContainer(WorkflowProcessInstanceImpl.java:69)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,257 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.NodeInstanceImpl.getNode(NodeInstanceImpl.java:101)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,258 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.NodeInstanceImpl.resolveContext(NodeInstanceImpl.java:217)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,259 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.NodeInstanceImpl.resolveContextInstance(NodeInstanceImpl.java:221)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,260 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.node.WorkItemNodeInstance.triggerCompleted(WorkItemNodeInstance.java:206)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,261 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.node.HumanTaskNodeInstance.triggerCompleted(HumanTaskNodeInstance.java:90)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,262 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.node.WorkItemNodeInstance.workItemCompleted(WorkItemNodeInstance.java:301)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,263 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.node.WorkItemNodeInstance.signalEvent(WorkItemNodeInstance.java:277)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,264 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:326)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,265 ERROR [stderr] (NioProcessor-4)     at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:121)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,266 ERROR [stderr] (NioProcessor-4)     at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:69)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,267 ERROR [stderr] (NioProcessor-4)     at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:32)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,267 ERROR [stderr] (NioProcessor-4)     at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,268 ERROR [stderr] (NioProcessor-4)     at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:367)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,269 ERROR [stderr] (NioProcessor-4)     at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:150)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,270 ERROR [stderr] (NioProcessor-4)     at org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler$GetResultContentResponseHandler.execute(CommandBasedWSHumanTaskHandler.java:364)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,271 ERROR [stderr] (NioProcessor-4)     at org.jbpm.task.service.TaskClientHandler.messageReceived(TaskClientHandler.java:153)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,272 ERROR [stderr] (NioProcessor-4)     at org.jbpm.task.service.mina.MinaTaskClientHandler.messageReceived(MinaTaskClientHandler.java:47)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,273 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,274 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,275 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,276 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,277 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,278 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,279 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,280 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,281 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,282 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,283 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,284 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,285 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,285 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,286 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,287 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,288 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,289 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,290 ERROR [stderr] (NioProcessor-4)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,290 ERROR [stderr] (NioProcessor-4)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>11:03:23,291 ERROR [stderr] (NioProcessor-4)     at java.lang.Thread.run(Thread.java:722)</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/787295#787295">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>