Hi Roberto,
Thanks for the quick reply.
You mean, on line 32 of your code? I don't think that is necessary because you are already doing so on line 58. I'm not sure though, because I didn't run this code...
Hmmm, Actually in line 32 the RemoteService
Impl itself is exported.
In line 58 the RemoteService
FACTORY is exported.
If I remove line 32, I recieve a java.io.NotSerializableException: RemoteServiceImpl. So I guess I need to export both, the RemoteServiceFactory and the RemoteServiceImpl. As far as I understand, the RemoteServiceImpl needs to be exported as well to enable the client to access the server via the Proxy(Stubs) pattern. To make the RemoteServiceImpl serializable doesnt make sense to me because then RemoteServiceImpl gets transported to the client and executed on the client side only without communicating to the server.
Declaring a method in an interface with a throws clause means that the implementations can throw the listed exceptions, not that the implementations have to throw them. It's not strange
That's obviously true
. I was just wondering, if the actual class method does not declare the RemoteException, even if the interface did so, how will a error during execution of a remote method call indicated? Or is this somehow handled by RMI itself?