> -----Original Message----- > From: Ernest Friedman-Hill [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 30, 1999 12:26 PM > To: [EMAIL PROTECTED] > Subject: Re: JESS: Run Rete Exception -- was: definstances & > undefinstances > > Hi Dan, Hi! Thanks for the quick response on this! >... > So, to fix it, it has to block modifications of the Rete network > inbetween those two statements. THis means synchronizing on the > object returned by Rete.getCompiler(); so change the middle of > Retract.call() in Funcall.java to look like this: >... Rats! Problem still there. I changed to code to read for (int i=1; i< vv.size(); i++) { synchronized (engine.getCompiler()) { ValueVector f = engine.findFactByID(vv.get(i).factIDValue()); if (f == null) continue; // Undefinstance, if needed. ... and also inserted println lines just before the exception throw in jess/NodeNot2.java i.e. System.out.println(lt); System.out.println(rt); but the problem still occurs. Here's the output along with a stack dump and the exception printed. JESS ABOUT to raise pumping rate of pump MAIN [Token: size=1;sortcode=86;tag=ADD;negcnt=-1;facts=(tank <Fact-86> "MAIN" FALSE <External-Address:ja va.lang.Class> TRUE 197 TRUE <External-Address:jesspumps.Tank>);] [Token: size=1;sortcode=85;tag=REMOVE;negcnt=0;facts=(warning <Fact-85> (low "MAIN"));] Rete Exception in routine NodeNot2::RunTestsVaryLeft. Message: Corrupted Negcnt (< 0) . at jess/NodeNot2.runTestsVaryLeft (NodeNot2.java:144) at jess/NodeNot2.runTestsVaryLeft (NodeNot2.java:120) at jess/NodeNot2.runTestsVaryLeft (NodeNot2.java:120) at jess/NodeNot2.runTestsVaryLeft (NodeNot2.java:120) at jess/NodeNot2.runTestsVaryLeft (NodeNot2.java:120) at jess/Node2.callNode (Node2.java:186) at jess/Node.passAlong (Node.java:136) at jess/Node1MTEQ.callNode (Node1.java:668) at jess/Node.passAlong (Node.java:136) at jess/Node1MTELN.callNode (Node1.java:708) at jess/Node.passAlong (Node.java:136) at jess/Node1TECT.callNode (Node1.java:479) at jess/Rete.processTokenOneNode (Rete.java:736) at jess/Rete.processToken (Rete.java:753) at jess/Rete._retract (Rete.java:575) at jess/Retract.call (Funcall.java:415) at jess/Funcall.simpleExecute (Funcall.java:336) at jess/Funcall.execute (Funcall.java:297) at jess/Funcall.execute (Funcall.java:196) at jess/Defrule.fire (Defrule.java:316) at jess/Activation.fire (Activation.java:55) at jess/Rete.run (Rete.java:1061) at jess/Rete.run (Rete.java:1039) at jess/HaltEtc.call (Funcall.java:1439) at jess/Funcall.simpleExecute (Funcall.java:336) at jess/Funcall.execute (Funcall.java:297) at jess/Funcall.execute (Funcall.java:196) at jess/Jesp.parseAndExecuteFuncall (Jesp.java:1386) at jess/Jesp.parseSexp (Jesp.java:161) at jess/Jesp.parse (Jesp.java:61) at jess/Rete.executeCommand (Rete.java:1091) at jesspumps/MainInJava.main (MainInJava.java:50) Rete Exception in routine NodeNot2::RunTestsVaryLeft while executing rule LHS: [NodeNot2 ntests=1 [Test2: test=EQ;tokenIdx=0;leftIdx=2;leftSubIdx=-1;rightIdx=2;rightSubIdx=1] ;usecount = 1] while executing defrule raise-rate-if-low. Message: Corrupted Negcnt (< 0) at line 0: ( run ) . Let me know if there's any more info that would be helpful. > Re: changes in ReflectFunctions outlines below: I don't think they're > necessary or warranted. Hmmm. It looked to me like there might be a problem if one thread was executing Definstance.propertyChange while another thread was calling Definstance.undefine (e.g. if propertyChange got executed right after undefine did its retraction and/or removal.) -- Dan Dan Larner, [EMAIL PROTECTED] Xerox PARC, 3333 Coyote Hill Rd., Palo Alto, CA, USA 94304 --------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list. List problems? Notify [EMAIL PROTECTED] ---------------------------------------------------------------------
RE: JESS: Run Rete Exception -- was: definstances & undefinstances
Larner, Dan <[EMAIL PROTECTED]> Mon, 1 Feb 1999 16:53:06 -0500
