<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Could you please try version 5.6.CR1 ?
      It's not available for download on the main<br>
      web site, but maven will be able to retrieve it.<br>
      It has many fixes, including some multi threading issues. If you
      still experience the problem, <br>
      we'll try and find a way to fix it in 5.6.Final, or test it with
      6.x<br>
      Thanks<br>
      Davide<br>
      <br>
      On 12/12/2013 07:34 AM, Anders Henriksson wrote:<br>
    </div>
    <blockquote
cite="mid:c62de3125b1742cc828256c7e94e76e5@DB4PR06MB174.eurprd06.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <style type="text/css" id="owaParaStyle" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
p
        {margin-top:0;
        margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
      <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
        style="font-family: Calibri,Arial,Helvetica,sans-serif;
        font-size: 12pt; color: #000000; margin: 0">
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">Hi!</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">We're running drools in a multi-server
          setup, with a pretty basic scenario:</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">1. When the first session is needed, we
          load the rulebase once. The rulebase is never changed after
          this (no rule removal or addition).</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">2. Each call spawns a new
          StatefulKnowledgeSession which is used for firing the rules
          once and then disposed. These calls are heavily
          multi-threaded, but each session is only used in a single
          method call from a single thread.</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">3. We use the resource scanner to check for
          updated packages. When an updated knowledge package is
          available, the knowledgebase is discarded and a new one
          constructed from the updated package.</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">The knowledge package affected is somewhat
          large - about 25 MB in size. (There are other, smaller
          knowledge packages which do not appear to have this issue.)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">This setup has been working fine, but
          somewhat slow. After upgrading to 5.5.0.Final and adding some
          speedups in the surrounding code we get a spurious null
          pointer. The trail of events is:</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">1. After start all servers work fine.</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">2. Sometime after a couple of hours to a
          couple of days, the null pointer error occurs on one or more
          servers (but generally not all of them).</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">3. Once the null pointer occurs, it happens
          on all further calls using that knowledgebase. No other
          knowledgebases are effected. (You can load the same package in
          a new knowledgebase, and sessions using the new, identical,
          knowledgebase work just fine.)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">4. Restarting the java process makes the
          server work fine again.</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">Calls always fail with the same stack
          trace:</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">org.drools.RuntimeDroolsException:
          Unexpected exception executing action
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction@5db53f</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">24</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:995)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
          org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:335)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
          org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp;&lt;stacktrace from our calling code
          omitted&gt;</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">Caused by: java.lang.NullPointerException</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
          org.drools.rule.EvalCondition.createContext(EvalCondition.java:107)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.reteoo.EvalConditionNode.createMemory(EvalConditionNode.java:261)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.common.ConcurrentNodeMemories.createNodeMemory(ConcurrentNodeMemories.java:90)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.common.ConcurrentNodeMemories.getNodeMemory(ConcurrentNodeMemories.java:69)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.common.AbstractWorkingMemory.getNodeMemory(AbstractWorkingMemory.java:1034)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.reteoo.EvalConditionNode.assertLeftTuple(EvalConditionNode.java:174)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:145)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:154)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
          org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
          org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
          org.drools.reteoo.Rete.assertObject(Rete.java:109)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
          org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:286)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:434)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:993)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; ... 93 more</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">Unfortunately we don't have the remaining
          rows in the wrapped exception.</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">From this trace, it looks like the problem
          is in EvalCondition:</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; public Object createContext() {</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; &nbsp; &nbsp; return
          this.expression.createContext();</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; &nbsp; }</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">which should only be able to produce a null
          pointer if expression is missing. Looking at the constructors
          for this class, having a null expression seems like a valid
          use case - but if this is a valid use case, why doesn't
          createContext() handle this case?</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">Considering that running drools with the
          same package and the same inputs can either fail with the
          above error (if knowledgebase has been used enough) or work
          just as intended (using a newly minted knowledgebase), it
          feels like something is corrupting the knowledgebase. Does
          this make sense?</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">(I noticed in the issue tracker (
          <a class="moz-txt-link-freetext" href="https://issues.jboss.org/browse/DROOLS-156">https://issues.jboss.org/browse/DROOLS-156</a> ) that memory for
          eval nodes are 'created "too lazily"' - might this be a
          related issue?)</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px"><br>
        </div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">Best regards,</div>
        <div name="divtagdefaultwrapper" id="divtagdefaultwrapper"
          style="margin:0px">&nbsp; Anders</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></pre>
    </blockquote>
    <br>
  </body>
</html>