I\'m trying to implement a middle-ware for group communication in a distributed system using Java RMI.
In there, I need to send an object to the server and modify it
When you use RMI you are having 2 (or more) java virtual machines involved in a given computation, so when you create an object at the client-side and call a method on the server passing this object as an argument the state of the object is serialized and sent through the network. On the server-side, a new object of the same class is created and the state is set on it, but it is a different object with the same values in it. Operating on this clone won't reflect on the original object that is still residing on the source virtual machine.
You could use a rmiregistry on each machine that runs a virtual machine and registering each object to expose it (this is a distributed solution) or you could concentrate all the data objects on the machine that has the rmiregistry (this is a centralized solution, since all objects are on the same machine).
Cheers!
RMI isn't magic. It is Remote Method Invocation. You have to call a remote method to get something to happen in a remote place. Just changing a variable and having it magically propagate across a network isn't within the scope of RMI.
Whatever you want to happen remotely has to be defined by methods in your remote interface(s).