<br>    It must be after serialization. I guess you might also be using interfaces (or superclasses) as patterns in the rules and inserting the implementations (or subclasses) as facts?<br><br>   This obviously should not be a problem, but I hope the above helps you narrow down the scenario. <br>
<br>   Thanks,<br>       Edson<br><br><div class="gmail_quote">2009/10/20 Nicholas Hemley <span dir="ltr">&lt;<a href="mailto:nic.hemley@sidonis.com">nic.hemley@sidonis.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">










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

<div>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Edson,</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Many thanks for this: yes, we do use serialization so I will try
and identify the exact case where this error happens.</span></p><div class="im">

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(31, 73, 125);">Cheerio,</span></p>

<p class="MsoNormal"><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(31, 73, 125);">Nic</span></p>

<p class="MsoNormal"><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);">Nicholas Hemley</span></b></p>

<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);">Senior Developer</span></b></p>

<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);">Sidonis | Powering a New Generation of Service Assurance</span></b><span style="font-size: 8pt; color: rgb(31, 73, 125);"></span></p>

<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);"> </span></b></p>

</div><p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);">e: </span></b><span style="font-size: 8pt; color: rgb(31, 73, 125);"><a href="mailto:carol.hopperton@sidonis.com" target="_blank">nic.hemley@sidonis.com</a><b></b></span></p>


<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);">m: </span></b><span style="font-size: 8pt; color: rgb(31, 73, 125);">+44 (0)7956 695 037</span></p>

<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);">t:   </span></b><span style="font-size: 8pt; color: rgb(31, 73, 125);">+44 (0)1225 446060</span></p>

<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);">skype:  nicholas.hemley</span></b><span style="font-size: 8pt; color: rgb(31, 73, 125);"></span></p>

<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);">w: <a href="http://www.sidonis.com/" target="_blank">www.sidonis.com</a></span></b></p>

<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);"> </span></b></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"><img src="cid:image001.jpg@01CA519B.C3CBBB10" alt="sidlogol esig" border="0" height="63" width="120"></span><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p>


<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 8pt; color: rgb(15, 36, 62);">Sidonis Limited. Registered No:  5718402. Registered
Office:  2-4 Henry Street, Bath, Somerset. BA1 1JT.  VAT Registration
No:  879658932.   </span></p>

<p class="MsoNormal"><span style="font-size: 8pt; color: rgb(15, 36, 62);"> </span></p>

<p class="MsoNormal"><span style="font-size: 8pt; color: rgb(15, 36, 62);">This e-mail and the information it contains may be confidential,
legally privileged and protected by law. Access by the intended recipient only
is authorised.  If you are not the intended recipient, please notify the
sender immediately and delete this e-mail from your system.  Any review,
distribution, reproduction, publication or other use of this e-mail by persons
or entities other than the intended recipient is prohibited.</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">

<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Edson Tirelli<br>
<b>Sent:</b> 20 October 2009 15:18<br>
<b>To:</b> Rules Users List<br>
<b>Subject:</b> Re: [rules-users] ClassCastException -
org.drools.reteoo.BetaMemory</span></p>

</div><div><div></div><div class="h5">

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

<p class="MsoNormal" style="margin-bottom: 12pt;"><br>
    This is a bug. Would you please open a JIRA and attach as
much information about the scenario as you can? A test case would be ideal,
even if the problem does not happen every single run. Also, are you using
serialization in your application? <br>
<br>
    Edson</p>

<div>

<p class="MsoNormal">2009/10/20 Nicholas Hemley &lt;<a href="mailto:nic.hemley@sidonis.com" target="_blank">nic.hemley@sidonis.com</a>&gt;</p>

<div>

<div>

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

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

<p class="MsoNormal">I
am getting the following intermittent error from drools 5.0.1 when removing a
knowledge package from a knowledge base:</p>

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

<p class="MsoNormal">org.drools.reteoo.BetaMemory
cannot be cast to org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory</p>

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

<p class="MsoNormal">I
iterate over knowledgeBase.getKnowledgePackages() and the error occurs, but
only occasionally.</p>

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

<p class="MsoNormal">The
full trace is as follows:</p>

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

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 95);">java.lang.ClassCastException:
org.drools.reteoo.BetaMemory cannot be cast to
org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 95);">at
org.drools.reteoo.RuleTerminalNode.doRemove(RuleTerminalNode.java:357)</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 95);">at
org.drools.common.BaseNode.remove(BaseNode.java:95)</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 95);">at
org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:237)</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 95);">at
org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:366)</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 95);">at
org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:712)</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 95);">at
org.drools.common.AbstractRuleBase.removePackage(AbstractRuleBase.java:640)</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 95);">at
org.drools.impl.KnowledgeBaseImpl.removeKnowledgePackage(KnowledgeBaseImpl.java:166)</span></p>

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

<p class="MsoNormal">Any
ideas why this would potentially happen?</p>

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

<p class="MsoNormal"><span style="font-size: 10.5pt; font-family: Consolas;">Cheerio,</span></p>

<p class="MsoNormal"><span style="font-size: 10.5pt; font-family: Consolas;">Nic</span></p>

<p class="MsoNormal"><span style="font-size: 10.5pt; font-family: Consolas;"> </span></p>

<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);">Nicholas Hemley</span></b></p>

<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);">Senior Developer</span></b></p>

<p class="MsoNormal"><b><span style="font-size: 8pt; color: rgb(31, 73, 125);">Sidonis | Powering a New Generation of
Service Assurance</span></b></p>

</div>

</div>

<p class="MsoNormal" style="margin-bottom: 12pt;"><br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></p>

</div>

<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <br>
 Edson Tirelli<br>
 JBoss Drools Core Development<br>
 JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a></p>

</div></div></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><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>