<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I&#8217;m trying to update our application from Drools 4.0.7 to Drools 5.5 (or 5.3 if that&#8217;s better).<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">All the rules compile and I am serializing the KnowledgeBase and reading it in upon application start-up.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Inserting facts works find.&nbsp; Retracting can often return the NullPointerException shown below.&nbsp; That clip comes from a unit test that literally just inserts 10 &#8220;TestFact&#8221; objects and then tries to retract them one at a time.&nbsp; No rule firing
 happens, just insertion and retraction.&nbsp; I did try adding a rule firing in between the insert and retraction loops but it made no difference.&nbsp; These &#8220;TestFact&#8221; object don&#8217;t actually trigger any rules if that matters.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I&#8217;ve tried this with both the Drools 5.5.0.Final and 5.3.0.Final jars with the same results.&nbsp; Searches on the forum and on Google show this as a bug in 5.5.0.Final, but say it should work in 5.3.0.Final.&nbsp; It doesn&#8217;t work on either for me.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I am going to try some variations on this test, but it seems like this should work as-is.&nbsp;
<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Any suggestions would be greatly appreciated.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">2013-10-14 11:56:02,533 (ERROR) [AgdKnowledgeSession] caught exception trying to retract TestFact [name=testfact-0]</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">java.lang.NullPointerException</span></u><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.core.util.RightTupleIndexHashTable.remove(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">RightTupleIndexHashTable.java:365</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.reteoo.NotNode.retractRightTuple(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">NotNode.java:172</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.reteoo.ObjectTypeNode.retractObject(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">ObjectTypeNode.java:257</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.reteoo.EntryPointNode.retractObject(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">EntryPointNode.java:330</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.common.NamedEntryPoint.retract(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">NamedEntryPoint.java:542</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.common.NamedEntryPoint.retract(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">NamedEntryPoint.java:486</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.teradata.agd.AgdKnowledgeSession.retract(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">AgdKnowledgeSession.java:134</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.teradata.agd.AgCoreManager.executeFactEvent(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">AgCoreManager.java:279</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.teradata.agd.AgCoreManager.executeRuleEngine(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">AgCoreManager.java:189</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.teradata.agd.AgCoreManager.enqueue(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">AgCoreManager.java:259</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.teradata.agd.AgCoreManager.retractFact(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">AgCoreManager.java:480</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.teradata.agdtest.functional.FactInsertionAndRetractionTest.testFactInsertion(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">FactInsertionAndRetractionTest.java:50</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke0(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">Native Method</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.reflect.Method.invoke(Unknown Source)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.internal.MethodInvocationHelper.invokeMethod(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">MethodInvocationHelper.java:84</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.internal.Invoker.invokeMethod(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">Invoker.java:714</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.internal.Invoker.invokeTestMethod(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">Invoker.java:901</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.internal.Invoker.invokeTestMethods(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">Invoker.java:1231</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.internal.TestMethodWorker.invokeTestMethods(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">TestMethodWorker.java:127</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.internal.TestMethodWorker.run(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">TestMethodWorker.java:111</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.TestRunner.privateRun(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">TestRunner.java:767</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.TestRunner.run(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">TestRunner.java:617</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.SuiteRunner.runTest(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">SuiteRunner.java:335</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.SuiteRunner.runSequentially(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">SuiteRunner.java:330</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.SuiteRunner.privateRun(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">SuiteRunner.java:291</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.SuiteRunner.run(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">SuiteRunner.java:240</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.SuiteRunnerWorker.runSuite(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">SuiteRunnerWorker.java:52</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.SuiteRunnerWorker.run(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">SuiteRunnerWorker.java:86</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.TestNG.runSuitesSequentially(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">TestNG.java:1224</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.TestNG.runSuitesLocally(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">TestNG.java:1149</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.TestNG.run(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">TestNG.java:1057</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.remote.RemoteTestNG.run(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">RemoteTestNG.java:111</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.remote.RemoteTestNG.initAndRun(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">RemoteTestNG.java:204</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.testng.remote.RemoteTestNG.main(</span><u><span style="font-size:10.0pt;font-family:Consolas;color:navy">RemoteTestNG.java:175</span></u><span style="font-size:10.0pt;font-family:Consolas;color:red">)</span><o:p></o:p></p>
</div>
</body>
</html>