Hi Ernest,

Following your suggestion I used the getNextException() method to get the
real error message:

The JessException:
Jess reported an error in routine Node1TECT.call while executing rule LHS
(TECT).
  Message: Error during LHS execution.
  Program text: ( defrule test-rule ( have ( possession_type ?*book* ) ) = >
( printout t "I have a book" crlf ) )  at line 6.
        at jess.Node1TECT.callNodeRight(jess/Node1TECT.java:54)
        at jess.Rete.updateNodes(jess/Rete.java:890)
        at jess.ReteCompiler.addRule(jess/ReteCompiler.java:87)
        at jess.Rete.addDefrule(jess/Rete.java:708)
        at jess.Jesp.addARule(jess/Jesp.java:1024)
        at jess.Jesp.doParseDefrule(jess/Jesp.java:978)
        at jess.Jesp.parseDefrule(jess/Jesp.java:901)
        at jess.Jesp.parseSexp(jess/Jesp.java:159)
        at jess.Jesp.parse(jess/Jesp.java:62)
        at
storyagents.LoadJessFileBehaviour.action(LoadJessFileBehaviour.java:59)
        at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:246)
        at jade.core.Agent.mainLoop(Agent.java:1705)
        at jade.core.Agent.run(Agent.java:1525)
        at java.lang.Thread.run(Unknown Source)

The inner exception:
java.lang.NullPointerException
        at jess.Node2.askForBackChain(jess/Node2.java:501)
        at jess.Node2.callNodeLeft(jess/Node2.java:185)
        at jess.Node1RTL.passAlong(jess/Node1RTL.java:33)
        at jess.Node1RTL.callNodeRight(jess/Node1RTL.java:23)
        at jess.Node1.passAlong(jess/Node1.java:60)
        at jess.Node1TECT.callNodeRight(jess/Node1TECT.java:43)
        at jess.Rete.updateNodes(jess/Rete.java:890)
        at jess.ReteCompiler.addRule(jess/ReteCompiler.java:87)
        at jess.Rete.addDefrule(jess/Rete.java:708)
        at jess.Jesp.addARule(jess/Jesp.java:1024)
        at jess.Jesp.doParseDefrule(jess/Jesp.java:978)
        at jess.Jesp.parseDefrule(jess/Jesp.java:901)
        at jess.Jesp.parseSexp(jess/Jesp.java:159)
        at jess.Jesp.parse(jess/Jesp.java:62)
        at
storyagents.LoadJessFileBehaviour.action(LoadJessFileBehaviour.java:59)
        at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:246)
        at jade.core.Agent.mainLoop(Agent.java:1705)
        at jade.core.Agent.run(Agent.java:1525)
        at java.lang.Thread.run(Unknown Source)

So the error happens in line 501 of Node2.java. This is in the method
askForBackChain(Token token). It has something to do with this piece of
code:

                // If this is a variable, and we can pull a value out of the token,
                // we're golden; but if this is the first occurrence, forget it.
                else if (test.m_slotValue instanceof Variable) {
                        BindingValue b = (BindingValue) m_defrule.getBindings().
                                get(test.m_slotValue.variableValue(null));

The BindingValue b == null. This causes the error in line 501 (if
(b.getFactNumber() < token.size()) {). As I lack a deeper understanding of
the code, I was unable to find out anything more :-(

Bye,
Sander


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On
> Behalf Of [EMAIL PROTECTED]
> Sent: donderdag 4 april 2002 18:38
> To: [EMAIL PROTECTED]
> Subject: Re: JESS: Again: backward chaining definstance facts
>
>
> Hi Sander,
>
> The actual exception that was thrown would be returned by the
> JessException.getNextException() method. It's not a JessException;
> it's some other kind of Exception which occurs and Jess wraps in a
> JessException -- hence the vague wording "Error during LHS execution."
> Can you modify your Java code so that when it catches a JessException
> it does what is described in the last paragraph of Jess manual section
> 4.1. The stack trace from the contained exception should tell us
> what's really going wrong.


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to