<div dir="ltr"><div><div>Wolfgang,<br>thank you for your prompt reply.  After further work with my code I think the culprit may have either been the setting of the event expiration time to 1s OR that I was using session.update to insert a new counter object; but maybe not.  I cleaned up my code in order to send it out.  In doing so I also downloaded the official Drools 5.5 distribution (in the previous example I was using the libraries packaged with BRMS).  Between the code cleanup and the use of the official distro I&#39;m no longer experiencing a Consequence Exception.  <br>
<br>That being said I am still experiencing a NPE when a high iteration count.  If you take a look at Drools5FusionEval.java, around line 51 you&#39;ll see a variable &#39;eventLimit&#39;.  If set to 500000 it seems to pretty reliably kick out the following NPE:<br>
<br>Exception in thread &quot;Thread-1&quot; java.lang.NullPointerException<br>    at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1319)<br>    at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1221)<br>
    at org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1434)<br>    at org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:755)<br>    at org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:731)<br>
    at org.drools.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:247)<br>    at drools5fusioneval.Drools5FusionEval$1.run(Drools5FusionEval.java:47)<br><br></div>As I&#39;ve said I&#39;m still very new to Drools and trying to understand better how it does what it does - any information that anyone can provide to help me understand why the above error is being experienced would be greatly appreciated.<br>
<br></div><div>Source code and rules are attached.<br></div><div><br>Sincerely,<br></div>Jason<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 4, 2013 at 7:58 AM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@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">Works for me (5.5.0, 5.4.0) - at least based on the code you&#39;ve posted<br>
which (apart from the omitted getters and setters) isn&#39;t the one you&#39;ve<br>
been running, and so you may have changed or omitted something<br>
that&#39;s essential.<br>
<br>
The full stack dump might shed some more light on this, and the full and<br>
true code of the rule RHS whre the NPE is caused.<br>
<br>
-W<br>
<div><div class="h5"><br>
On 04/05/2013, Jason Barto &lt;<a href="mailto:jason.p.barto@gmail.com">jason.p.barto@gmail.com</a>&gt; wrote:<br>
&gt; I am new to Drools (Expert and Fusion) and have been reading through the<br>
&gt; materials over the last few days.  After going through some of the tutorial<br>
&gt; code I wrote a very quick and dirty to perform a base assessment of the<br>
&gt; speed of Fusion / Expert.  My code is below.  The strange thing I&#39;m<br>
&gt; currently receiving is, if I insert 100k events the test completes<br>
&gt; successfully, if I insert 150k events, I receive a ConsequenceException<br>
&gt; caused by an NPE.  Being new to Drools I must be doing something wrong, can<br>
&gt; anyone please provide some guidance?<br>
&gt;<br>
&gt; (Main function)<br>
&gt; Counter cc = new Counter ();<br>
&gt; session.insert (cc);<br>
&gt; for (int i = 0; i &lt; 150000; i++) {<br>
&gt;   entryPoint01.insert (new MyEvent ());<br>
&gt; }<br>
&gt;<br>
&gt; (Counter Class)<br>
&gt; public class Counter {<br>
&gt;   private long total = 0;<br>
&gt;   // get / set total<br>
&gt;   public void addValue (int val) {<br>
&gt;     total += val;<br>
&gt;   }<br>
&gt; }<br>
&gt;<br>
&gt; (MyEvent Class)<br>
&gt; public class MyEvent {<br>
&gt;   private int value = 1;<br>
&gt;   // get / set value<br>
&gt; }<br>
&gt;<br>
&gt; (DRL file)<br>
&gt; declare MyEvent<br>
&gt;   @role (event)<br>
&gt;   @expires (1s)<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;Count the rules&quot;<br>
&gt; when<br>
&gt;   $ev : MyEvent () from entry-point entryPoint01<br>
&gt;   $pc : Counter ()<br>
&gt; then<br>
&gt;   $cc.addValue ($ev.getValue ());<br>
&gt; end<br>
&gt;<br>
</div></div>_______________________________________________<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>
</blockquote></div><br></div>