I may be wrong, but I think this has to do with Jess requiring PropertyChangeListeners if you don't specify a (definstance) as static. For "dynamic" definstances Jess needs a mechanism for knowing when slots change on a Java object, and so relies on being able to install a PropertyChangeListener for monitoring beans.

The information about definstance can be found in "2.7.4. Definstance facts" in the Jess manual chapter "The Jess Language". Here is the page that has that section http://herzberg.ca.sandia.gov/jess/docs/61/language.html.

--jason

On Mar 29, 2004, at 3:57 PM, Michael Knapik wrote:

Folks,

I successfully compiled the example Java DynamicDimmerSwitch code on pp 92-93 of Jess In Action.

The next step (and the last item in the chapter)�was to hook up Jess to the new switch��JavaBean (I previously successfully did so with the DimmerSwitch example)

Here is the outcome (yes the import is in the java code, yes I have the latest JDK etc.)

Jess> (defclass dimmer DimmerSwitchDynamic)

DimmerSwitchDynamic
Jess> (bind ?ds (new DimmerSwitchDynamic))

<External-Address:DimmerSwitchDynamic>
Jess> (definstance dimmer ?ds)

Jess reported an error in routine DefinstanceList.definstance
�while executing (definstance dimmer ?ds).
� Message: Obj doesn't accept PropertyChangeListeners.
� Program text: ( definstance dimmer ?ds )� at line 213.
Nested exception is:
DimmerSwitchDynamic.addPropertyChangeListener(java.beans.PropertyChange Listener)
java.lang.NoSuchMethodException: DimmerSwitchDynamic.addPropertyChangeListener(java.beans.PropertyChange Listener)
�at java.lang.Class.getMethod(Unknown Source)
�at jess.d7.a(Unknown Source)
�at jess.Rete.definstance(Unknown Source)
�at jess.a3.call(Unknown Source)
�at jess.ep.a(Unknown Source)
�at jess.Funcall.execute(Unknown Source)
�at jess.Jesp.a(Unknown Source)
�at jess.Jesp.for(Unknown Source)
�at jess.Jesp.parse(Unknown Source)
�at jess.Jesp.parse(Unknown Source)
�at jess.Main.execute(Unknown Source)
�at JessWin.jessExecute(JessWin.java:1115)
�at JessWin$63.run(JessWin.java:1062)
�at java.lang.Thread.run(Unknown Source)
Jess>

Thoughts?

(PS; for one person on this list�with initials JM�- no item in the rest of the book addresses THIS question)

Mke




Reply via email to