The issue was with the port number at client side. Specify the port number also while getting the Registry
.
Java Doc for LocateRegistry.getRegistry("localhost")
says:
Returns a reference to the the remote object Registry for the local host on the default registry port of 1099.
Try
Client.java (specify the port no)
Registry reg = LocateRegistry.getRegistry("localhost",9260);
or
Server.java (use default port no)
Registry registry = LocateRegistry.createRegistry(1099);