<p><font size=2 color=navy face=Arial>
Hi Nicolas,<br><br>Thanks for the response. The strange thing is I do not get this error when I run inside the debugger with the same facts. This made me believe it is a timing issue. I am using the latest stable drools - 5.0.1<br><br>Thanks<br><br> Glenn</font></p>
<p><hr size=2 width="100%" align=center tabindex=-1>
<font face=Tahoma size=2>
<b>From</b>: rules-users-bounces@lists.jboss.org <rules-users-bounces@lists.jboss.org> <br><b>To</b>: Rules Users List <rules-users@lists.jboss.org> <br><b>Sent</b>: Wed Feb 10 18:18:57 2010<br><b>Subject</b>: Re: [rules-users] CEP Error <br></font></p>
Hi,<div>It says that the $param is null so $<a href="http://param.name">param.name</a>() cannot be called</div><div><font class="Apple-style-span" face="&#39;Courier New&#39;"><span class="Apple-style-span" style="font-family: arial; "><span style="font-size: 10pt; font-family: &#39;Courier New&#39;; color: black; "><span class="Apple-style-span" style="font-family: arial; font-size: small; "><span style="font-size: 10pt; font-family: &#39;Courier New&#39;; color: green; "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-style-span" style="font-family: arial; font-size: small; "><span style="font-size: 10pt; font-family: &#39;Courier New&#39;; color: black; ">regards</span></span></span></span></span></span></span></font></div>
<div><font class="Apple-style-span" face="&#39;Courier New&#39;"><span class="Apple-style-span" style="font-family: arial; "><span style="font-size: 10pt; font-family: &#39;Courier New&#39;; color: black; "><span class="Apple-style-span" style="font-family: arial; font-size: small; "><span style="font-size: 10pt; font-family: &#39;Courier New&#39;; color: green; "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-style-span" style="font-family: arial; font-size: small; "><span style="font-size: 10pt; font-family: &#39;Courier New&#39;; color: black; ">Nicolas</span></span></span></span></span></span></span></font></div>
<div><br><div class="gmail_quote">2010/2/10 Glenn Macgregor <span dir="ltr">&lt;<a href="mailto:gmacgregor@pocketkings.ie">gmacgregor@pocketkings.ie</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">









<div lang="EN-IE" link="blue" vlink="purple">

<div>

<p class="MsoNormal">Hi All,</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">I have a simple CEP test case which I am working through. I
am currently getting a NullPointerException in the Consequence and have no idea
why.</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal" style="text-autospace:none"><b>Rule:<br>
</b><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">rule</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;Param
Update Event Rule&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">      </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">when</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">            $pue :
ParameterUpdateEvent(name == </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;testParam2&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">, $param : param) </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">from</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> entry-point </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;ParamUpdateStream&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">      </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">then</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">            </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:olive">#System.out.println(&quot;Param
&#39;&quot; + $pue.getName() + &quot;&#39; has been updated to &quot; +
$pue.getValue());</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">            System.out.println(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;HERE!!!
&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> + $param + </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">&quot; &quot; + $<a href="http://param.name" target="_blank">param.name</a>()</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">);</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">End</span></b></p>

<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000"> </span></b></p>

<p class="MsoNormal"><b>Exception &amp; Debug:</b></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">OBJECT ASSERTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@1265109
factId: 2</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">OBJECT RETRACTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@1265109
factId: 2</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">OBJECT ASSERTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@5e8d7d
factId: 3</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">OBJECT RETRACTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@5e8d7d
factId: 3</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">ACTIVATION CREATED rule:Param Update
Event Rule activationId:Param Update Event Rule [4, 0] declarations:
$pue=ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@19b4748(4);
$param=ie.PocketKings.SystemsManagement.Alerting.Parameter@2431b9(4)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">Exception in thread &quot;Thread-3&quot; </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">BEFORE
ACTIVATION FIRED rule:Param Update Event Rule activationId:Param Update Event
Rule [4, 0] declarations:
$pue=ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@19b4748(4);
$param=ie.PocketKings.SystemsManagement.Alerting.Parameter@2431b9(4)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">OBJECT RETRACTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@19b4748
factId: 4</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">OBJECT ASSERTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@19b4748
factId: -1</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">org.drools.runtime.rule.ConsequenceException</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">: </span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">java.lang.NullPointerException</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">DefaultConsequenceExceptionHandler.java:23</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at
org.drools.common.DefaultAgenda.fireActivation(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">DefaultAgenda.java:943</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at
org.drools.common.DefaultAgenda.fireNextItem(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">DefaultAgenda.java:885</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at org.drools.common.DefaultAgenda.fireUntilHalt(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">DefaultAgenda.java:1065</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">AbstractWorkingMemory.java:701</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">AbstractWorkingMemory.java:678</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at
org.drools.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">StatefulKnowledgeSessionImpl.java:195</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at
ie.PocketKings.SystemsManagement.Alerting.SessionRunner.run(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">SessionRunner.java:13</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at java.lang.Thread.run(Unknown
Source)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">Caused by: </span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">java.lang.NullPointerException</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at
org.drools.base.ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent6011238$getParam.getValue(Unknown
Source)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at
org.drools.base.ClassFieldReader.getValue(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">ClassFieldReader.java:91</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at
org.drools.rule.Declaration.getValue(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">Declaration.java:244</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at
ie.PocketKings.SystemsManagement.Alerting.Rule_Param_Update_Event_Rule_0ConsequenceInvoker.evaluate(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">Rule_Param_Update_Event_Rule_0ConsequenceInvoker.java:16</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      at
org.drools.common.DefaultAgenda.fireActivation(</span><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">DefaultAgenda.java:934</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">      ... 7 more</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">OBJECT ASSERTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@19fdbcb
factId: 5</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">Could it be that my Event object is getting destroyed before the
consequence is run, is that what “OBJECT RETRACKED” means in this
case?</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">Thanks</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> Glenn</span></p>

<p class="MsoNormal"> </p>

</div>

</div>


<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>
<br></blockquote></div><br></div>