Ages and ages ago, before Java even -had- serialization yet, a mobile
agent application was the primary reason I began the Jess
project. When Serialization was put into Java 1.1., (after the
original application was no longer needed, alas) I began to add
support for it to Jess, and it turned out to be not as easy as you'd
think. The current design needs quite a bit of rework.

In any event, Jess has the (bsave) and (bload) commands, which store
and retrieve active Rete object (sans facts) to a file. If you want to
store and retrieve the facts as well, you can use (save-facts) and
(load-facts), but only if the facts are renderable as text - i.e.,
they can't have any Java objects as slot values. So one strategy for
doing what you want to do is to call (save-facts), then (bsave), on
the source end, send the two files to the destination end, then call
(bload) and (load-facts) on the destination end.

I'm hoping that by the Jess 6.0 release, I'll have things worked out
such that the straightforward process you tried will be sufficient.


I think Andreas Johansson wrote:
> I'm doing a little project in Java with mobile agents that jumps from
> computer to computer in a network to search for data. I have tested Jess
> a bit and found out that it would be very nice to use it as the "brain"
> for the agent. I.e. to decide when and where to move and what to do
> (what
> methods to run) when it gets there. Enough of backgound.
> 
> The agent transport system uses the Serializable interface to pack the
> objects before sending them over the network. Therefore I was pleased to 
> see that all the Jess classes seems to be serializable.
> 
> I have tried my agent system before including Jess and then everything
> worked just fine. Compileing the agent with the Rete engine and some
> small things (like some asserts) also worked fine. The agent could start
> at my computer, create the Rete engine, move to some other computer and
> then do some assertions and get back here.
> 
> But then I discovered the problem. The facts that I inserted were no
> longer available and had disappered! Either they weren't moved with the
> Agent, Rete object etc. or the Rete engine was resetted or cleared in
> some way when it reached the destination.
> 
> I also tried it a bit more by including a rule that would be fired on
> one of the facts that were included on the other computer. The line was
> (r is the Rete object):
> r.executeCommand("(defrule test (back again) 
>       => (assert (rule activated)))");
> 
> But then I got a long exception and the top of it are as follows:
> Fri Apr 14 11:28:57 CEST 2000=>TCPDistributor : ERROR : Caught exception
> handling a client
>  request: java.lang.ArrayStoreExceptionnull
>     java.lang.ArrayStoreException
>         at java.io.ObjectInputStream.inputArray(Compiled Code)
>         at java.io.ObjectInputStream.readObject(Compiled Code)
>         at java.io.ObjectInputStream.defaultReadObject(Compiled Code)
>         at java.io.ObjectInputStream.inputObject(Compiled Code)
>         at java.io.ObjectInputStream.readObject(Compiled Code)
>         at java.io.ObjectInputStream.inputArray(Compiled Code)
>         at java.io.ObjectInputStream.readObject(Compiled Code)
>         at java.io.ObjectInputStream.defaultReadObject(Compiled Code)
>         at java.io.ObjectInputStream.inputObject(Compiled Code)
>         at java.io.ObjectInputStream.readObject(Compiled Code)
>         at java.io.ObjectInputStream.defaultReadObject(Compiled Code)
>         at java.io.ObjectInputStream.inputObject(Compiled Code)
>         at java.io.ObjectInputStream.readObject(Compiled Code)
>         at java.io.ObjectInputStream.inputArray(Compiled Code)
>         at java.io.ObjectInputStream.readObject(Compiled Code)
>         at java.io.ObjectInputStream.defaultReadObject(Compiled Code)
>         at jess.Node.readObject(Node.java:138)
> 
> What I can read from this is that the agent transport system gets a
> problem when moving one of the Node objects and that one of its Arrays
> are null and then everything breaks. (I think that other Nodes are moved
> correctly, so it's not a general transport problem).
> 
> Does anyone have any suggestions about what to do? Is it even possible
> to move the entire Jess engine? Maybe if I somehow stores all the data
> from the
> engine and then move the data over in an new object and then creates a
> new engine and fills it with the data? But it feels like to much work
> since it *almost* works this way!
> 
> I think it would be really useful to have an mobile agent controlled by
> a
> rule based system like Jess!
> 
> I hope someone can please help me. If more details are required for you
> to be able to help me, just ask and I answer. I just thought that the
> mail was long enough already.
> 
> Best regards
>  Andreas Johansson, Sweden
> ---------------------------------------------------------------------
> 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]
---------------------------------------------------------------------

Reply via email to