hmm looks weird.. can you debug and review if the process is in the NodeInstance that it&#39;s supposed to be?<div><br><br><div class="gmail_quote">On Fri, Sep 24, 2010 at 12:25 PM, jawa <span dir="ltr">&lt;<a href="mailto:agohar@gmail.com">agohar@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Thanks mate<br>
<br>
It throws NullPointerException. Here is what I do. I start process and it<br>
stops at an AND node waiting for event to complete. The  process is backed<br>
up by JPA and is stored in db. Then I modify my test class and instead of<br>
creating session i load existing session. For example when i run my last<br>
test first time, it created a new session in db with id 18 and new process<br>
in db with id 24. So I use this code:<br>
<br>
<br>
                StatefulKnowledgeSession session =<br>
JPAKnowledgeService.loadStatefulKnowledgeSession(18,knowledgeBase, null,<br>
environment);<br>
                WorkItemManager manager = session.getWorkItemManager();<br>
                manager.registerWorkItemHandler(&quot;Human Task&quot;, new<br>
MyWorkItemHandler(true));<br>
<br>
                 ProcessInstance p = session.getProcessInstance(24);<br>
                System.out.println(&quot;Proc Found -&gt; &quot; + p.getClass());<br>
<div class="im">                if (p != null &amp;&amp; p.getState()==ProcessInstance.STATE_ACTIVE)<br>
                {<br>
<br>
</div>                        p.signalEvent(&quot;TestEvent&quot;, null);<br>
                }<br>
<br>
The debug statement above displays &quot;Proc Found -&gt; class<br>
org.drools.ruleflow.instance.RuleFlowProcessInstance&quot;<br>
<br>
And I get exception:<br>
<br>
15:41:29,528 ERROR [STDERR] java.lang.NullPointerException<br>
15:41:29,528 ERROR [STDERR]     at<br>
<div class="im">org.drools.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:67)<br>
</div>15:41:29,529 ERROR [STDERR]     at<br>
<div class="im">org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.getWorkflowProcess(WorkflowProcessInstanceImpl.java:185)<br>
</div>15:41:29,529 ERROR [STDERR]     at<br>
<div class="im">org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:346)<br>
</div>15:41:29,529 ERROR [STDERR]     at<br>
com.my.poc.PocFlowServiceImpl.processFlow(PocFlowServiceImpl.java:117)<br>
15:41:29,529 ERROR [STDERR]     at<br>
<div class="im">sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
</div>15:41:29,529 ERROR [STDERR]     at<br>
<div class="im">sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
</div>15:41:29,529 ERROR [STDERR]     at<br>
<div class="im">sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
</div>15:41:29,529 ERROR [STDERR]     at<br>
<div class="im">java.lang.reflect.Method.invoke(Method.java:597)<br>
</div>15:41:29,529 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)<br>
</div>15:41:29,529 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)<br>
</div>15:41:29,529 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)<br>
</div>15:41:29,529 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)<br>
</div>15:41:29,529 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)<br>
</div>15:41:29,531 ERROR [STDERR]     at<br>
<div class="im">sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
</div>15:41:29,531 ERROR [STDERR]     at<br>
<div class="im">sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
</div>15:41:29,531 ERROR [STDERR]     at<br>
<div class="im">sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
</div>15:41:29,531 ERROR [STDERR]     at<br>
<div class="im">java.lang.reflect.Method.invoke(Method.java:597)<br>
</div>15:41:29,531 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)<br>
</div>15:41:29,531 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,531 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)<br>
</div>15:41:29,532 ERROR [STDERR]     at<br>
org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_30161834.invoke(InvocationContextInterceptor_z_fillMethod_30161834.java)<br>
15:41:29,532 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,532 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)<br>
</div>15:41:29,532 ERROR [STDERR]     at<br>
org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_30161834.invoke(InvocationContextInterceptor_z_setup_30161834.java)<br>
15:41:29,532 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,532 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)<br>
</div>15:41:29,575 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,575 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)<br>
</div>15:41:29,575 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.tx.StatelessBMTInterceptor.handleInvocation(StatelessBMTInterceptor.java:106)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.tx.BMTInterceptor.invoke(BMTInterceptor.java:55)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,576 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:421)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)<br>
</div>15:41:29,577 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)<br>
</div>15:41:29,579 ERROR [STDERR]     at<br>
<div class="im">org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)<br>
</div>15:41:29,579 ERROR [STDERR]     at<br>
<div class="im">org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)<br>
</div>15:41:29,579 ERROR [STDERR]     at<br>
<div class="im">org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)<br>
</div>15:41:29,579 ERROR [STDERR]     at<br>
<div class="im">org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)<br>
</div>15:41:29,579 ERROR [STDERR]     at<br>
<div class="im">org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)<br>
</div>15:41:29,579 ERROR [STDERR]     at<br>
<div class="im">org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)<br>
<br>
</div><font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Events-Not-Working-tp1453738p1574659.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Events-Not-Working-tp1453738p1574659.html</a><br>

</font><div><div></div><div class="h5">Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> - CTO @ <a href="http://www.plugtree.com">http://www.plugtree.com</a>  <br> - MyJourney @ <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br>
 - Co-Founder @ <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -<br>
</div>