RMI automatically send stub of an object I was expecting to be serialized.

23 views
Skip to first unread message

francois...@gmail.com

unread,
Oct 27, 2014, 8:59:03 PM10/27/14
to js...@googlegroups.com
I have a basic application where my Server has a list of Tasks which can be of various kinds.

I want my clients to connect to the server, get a Task, execute the task locally, get a new task, ...

If I make Task an interface implemented by the various kinds of tasks (e.g., TaskA, TaskB), it seems ripeRMI will not serialize the tasks and ship them to the client. instead, it will send a stub and when the client tries to execute the task (using the execute method in the Task interface), then server actually ends up performing the execution (so the client was given a stub and not the actual object serialized). Note that none of the tasks are explicitly exported by my code, only the server class is. 

If, on the other hand, I make Task an AbstractClass extended by the various kind of tasks, everything works properly.

I believe this to be a bug... whenever an object implements an interface ripermi will send a stub instead of serializing it .

Is there any ways to force ripermi to serialize an object and not make a stub out of it ?

Thanks!
Reply all
Reply to author
Forward
0 new messages