posted 16 years ago
Hi all,
I am using RMI factory to generate a Service object for each client (since each will have its own Data object for identification).
The problem is: I generated the stub for the factory (RemoteServiceFactoryImpl) and the remote implementation of Service (RemoteServiceImpl).
The client correctly gets the factory stub, instead of dynamically downloading it. Though I can't get the RemoteServiceImpl stub.
Here is what I do in the factory:
In the client, when I use this getService() from the factory stub, I get complaints that RemoteServiceImpl is not Serializable (and everything it has, such as the delegated LocalService and Data).
If I make RemoteServiceImpl implement UnicastRemoteObject, then only RemoteService is Serializable, not LocalService and the rest of the chain. But in this case, the stub is never fetched, and this goes against the specs.
Do I really need to make everything Serializable? Is there another way around?
Thanks in advance.