Hi,
Thanks for this, although I'm still missing something I think.

The Order class I'm trying to define as an instance does have accessors and
modifiers for all its properties, including the two defined on the
superclass deftemplate that's already been created in the Rete.
Given this, I'm still a little confused as to how the nil Value arises that
causes the ClassCastException I'm getting and I'm still not sure how to
correct it.

Is there anything else that would cause this exception to be thrown?

Many thanks in advance

Regards
David




                                                                           
             ejfried                                                       
             Sent by:                                                      
             owner-jess-users@                                          To 
             sandia.gov                jess-users@sandia.gov               
                                                                        cc 
                                                                           
             05/10/2005 14:34                                      Subject 
                                       Re: JESS: Problem with definstance  
                                                                           
             Please respond to                                             
             [EMAIL PROTECTED]                                             
                   .gov                                                    
                                                                           
                                                                           




I think David Firmin wrote:

> I'm trying to create shadow facts that subclass a deftemplate that's
> already been added to the Rete. When I try and add the java bean using
> definstance I get a ClassCastException as follows:
>
> java.lang.ClassCastException
>       at
jess.DefinstanceList.createNewShadowFact(DefinstanceList.java:206)
>       at jess.DefinstanceList.definstance(DefinstanceList.java:275)

Jess is assuming that the given class "looks like" a subclass of the
deftemplate -- i.e., if the template has slots foo and bar, then the
class had better have getFoo() and getBar() methods. It can have
additional properties as well, of course, as befits a subclass.

In any case, this is a lousy error message -- Jess should explicitly
detect and report this problem.


---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
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]
--------------------------------------------------------------------

--------------------------------------------------------------------
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