I tried implementing RMI concept using the two computers connected in my company network. I binded the remote object using my ip address and specific port number. Everything worked fine when I tried it in my local machine.
Now In order to access it from the other computer I shared the Adder (extends Remote ) interface .class file with the other computer and a client code. When I tried to access it it throwed the ClassNotFoundException: stub not found.
So I shared the stub.class file which is generated after running the command >> rmic AddImpl. After that it worked fine on the remote computer also.
Now My question is, Is that how RMI is implemented ? Do we need to share both the Adder interface and the stub class file generated in order for a client to access our remote method ?
Below are My classes and interfaces:
interface Adder extends Remote
class AddImpl extends UnicastRemoteObject implements Adder
class Server
class Client