Well, if the class isn't public, Jess can't use reflection as needed
to access the bean methods, public or not (unless the methods are
overrides of inherited methods from a public base class or interface.)
That's just how Java security works these days.
That said, versions of Jess do exist where the IllegalAccessException
was inadvertently repressed, resulting in broken fact objects like the
one you see below being asserted. I can't say for sure off the top of
my head which versions do exhibit this behaviour, but I can say that
it is fixed in 6.0a2.
In any case, although this represents a bug in Jess, it's only a bug
in Jess's error handling; by definition, Java Beans have to be
public. Jess will also properly handle non-public Bean classes, as
long as all of their property accessors ar inherited from a public
base or from an interface.
I think Jerry Hoe wrote:
> Hi,
>
> I have bean trying out a simple test program to update a property of a bean using
> its setter method. Now, I notice that the outcome is different if I define the bean
> using its default access level.
>
> These are the outputs after executing the bean program with the following statements:
> ...
> bn.setName("Jerry");
> r.reset();
> ...
> r.executeCommand("(facts)");
>
> Output:
> public bean class
> -----------------
> f-0 (initial-fact)
> f-1 (mybean (class <External-Address:java.lang.Class>) (name "Jerry") (OBJECT
> <External-Address:MyBean>))
> For a total of 2 facts.
>
> non-public bean class
> ----------------------
> f-0 (mybean (class <External-Address:java.lang.Class>) (name <External-Address
> :jess.SerializablePropertyDescriptor>) (OBJECT <External-Address:MyBean>))
> For a total of 1 facts.
>
> Can someone please explain this behaviour? My impression is that perhaps the Jess
> classes that manipulate the bean internally belongs to the Jess package and therefore
> have some problems "seeing" the bean? Am I right?
>
> Also, why can't I find the jess.SerializablePropertyDescriptor class in the API doc?
>
> Thanks.
>
> --
> Best Regards,
> Jerry
>
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------