0 Replies Latest reply on Jan 3, 2013 5:50 AM by franco80

    Could not commit session: java.lang.NullPointerException after start process, start task and complete task in one method

    franco80 Novice

      Hello all,

       

      (Jbpm 5.3, JPA2, Jboss 7.1.1, new session is created when the server starts always)

       

      sometimes I get an exception when create a process, start a task, and the task is completed. The whole is carried out in a single method. Any ideas what is wrong  ?

       

      Code with null pointer:

       

                     public Process getProcess() {

                             if (this.process == null) {

      line 67 -->                this.process = kruntime.getKnowledgeBase().getProcess(processId);

                             }

                             return this.process;

                    }

       

       

      11:03:22,889 ERROR [org.drools.persistence.SingleSessionCommandService] (NioProcessor-4) Could not commit session: java.lang.NullPointerException

          at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:67) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]

          at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getWorkflowProcess(WorkflowProcessInstanceImpl.java:181) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]

          at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getNodeContainer(WorkflowProcessInstanceImpl.java:69) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.getNode(NodeInstanceImpl.java:101) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.resolveContext(NodeInstanceImpl.java:217) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.resolveContextInstance(NodeInstanceImpl.java:221) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]

          at org.jbpm.workflow.instance.node.WorkItemNodeInstance.triggerCompleted(WorkItemNodeInstance.java:206) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]

          at org.jbpm.workflow.instance.node.HumanTaskNodeInstance.triggerCompleted(HumanTaskNodeInstance.java:90) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]

          at org.jbpm.workflow.instance.node.WorkItemNodeInstance.workItemCompleted(WorkItemNodeInstance.java:301) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]

          at org.jbpm.workflow.instance.node.WorkItemNodeInstance.signalEvent(WorkItemNodeInstance.java:277) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]

          at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:326) [jbpm-flow-5.3.0.Final.jar:5.3.0.Final]

          at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:121) [drools-persistence-jpa-5.4.0.Final.jar:5.4.0.Final]

          at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:69) [drools-core-5.4.0.Final.jar:5.4.0.Final]

          at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:32) [drools-core-5.4.0.Final.jar:5.4.0.Final]

          at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36) [drools-core-5.4.0.Final.jar:5.4.0.Final]

          at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:367) [drools-persistence-jpa-5.4.0.Final.jar:5.4.0.Final]

          at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:150) [drools-core-5.4.0.Final.jar:5.4.0.Final]

          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]

          at org.jbpm.task.service.TaskClientHandler.messageReceived(TaskClientHandler.java:153) [jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]

          at org.jbpm.task.service.mina.MinaTaskClientHandler.messageReceived(MinaTaskClientHandler.java:47) [jbpm-human-task-mina-5.3.0.Final.jar:5.3.0.Final]

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969) [mina-core-2.0.0-RC1.jar:]

          at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.0.0-RC1.jar:]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]

       

      11:03:23,254 ERROR [stderr] (NioProcessor-4) java.lang.NullPointerException

       

      11:03:23,255 ERROR [stderr] (NioProcessor-4)     at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:67)

       

      11:03:23,256 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getWorkflowProcess(WorkflowProcessInstanceImpl.java:181)

       

      11:03:23,257 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getNodeContainer(WorkflowProcessInstanceImpl.java:69)

       

      11:03:23,257 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.NodeInstanceImpl.getNode(NodeInstanceImpl.java:101)

       

      11:03:23,258 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.NodeInstanceImpl.resolveContext(NodeInstanceImpl.java:217)

       

      11:03:23,259 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.NodeInstanceImpl.resolveContextInstance(NodeInstanceImpl.java:221)

       

      11:03:23,260 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.node.WorkItemNodeInstance.triggerCompleted(WorkItemNodeInstance.java:206)

       

      11:03:23,261 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.node.HumanTaskNodeInstance.triggerCompleted(HumanTaskNodeInstance.java:90)

       

      11:03:23,262 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.node.WorkItemNodeInstance.workItemCompleted(WorkItemNodeInstance.java:301)

       

      11:03:23,263 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.node.WorkItemNodeInstance.signalEvent(WorkItemNodeInstance.java:277)

       

      11:03:23,264 ERROR [stderr] (NioProcessor-4)     at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:326)

       

      11:03:23,265 ERROR [stderr] (NioProcessor-4)     at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:121)

       

      11:03:23,266 ERROR [stderr] (NioProcessor-4)     at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:69)

       

      11:03:23,267 ERROR [stderr] (NioProcessor-4)     at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:32)

       

      11:03:23,267 ERROR [stderr] (NioProcessor-4)     at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)

       

      11:03:23,268 ERROR [stderr] (NioProcessor-4)     at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:367)

       

      11:03:23,269 ERROR [stderr] (NioProcessor-4)     at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:150)

       

      11:03:23,270 ERROR [stderr] (NioProcessor-4)     at org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler$GetResultContentResponseHandler.execute(CommandBasedWSHumanTaskHandler.java:364)

       

      11:03:23,271 ERROR [stderr] (NioProcessor-4)     at org.jbpm.task.service.TaskClientHandler.messageReceived(TaskClientHandler.java:153)

       

      11:03:23,272 ERROR [stderr] (NioProcessor-4)     at org.jbpm.task.service.mina.MinaTaskClientHandler.messageReceived(MinaTaskClientHandler.java:47)

       

      11:03:23,273 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)

       

      11:03:23,274 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

       

      11:03:23,275 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

       

      11:03:23,276 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)

       

      11:03:23,277 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375)

       

      11:03:23,278 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229)

       

      11:03:23,279 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

       

      11:03:23,280 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

       

      11:03:23,281 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)

       

      11:03:23,282 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)

       

      11:03:23,283 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

       

      11:03:23,284 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)

       

      11:03:23,285 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638)

       

      11:03:23,285 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598)

       

      11:03:23,286 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587)

       

      11:03:23,287 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61)

       

      11:03:23,288 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969)

       

      11:03:23,289 ERROR [stderr] (NioProcessor-4)     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

       

      11:03:23,290 ERROR [stderr] (NioProcessor-4)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

       

      11:03:23,290 ERROR [stderr] (NioProcessor-4)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

       

      11:03:23,291 ERROR [stderr] (NioProcessor-4)     at java.lang.Thread.run(Thread.java:722)