tags:

views:

102

answers:

2
A: 

You could adapt this example It uses createRegistry instead of getRegistry you should use port 1099 instead of 80.

stacker
A: 

The problem with your code is you need to export your remote object

MethodsImp methods=new MethodsImp();

to the rmi registry.

you can do it by including this code

MethodsImp methods=new MethodsImp();
Hello stub = (Hello) UnicastRemoteObject.exportObject(methods, 0);

Hello is the name of the interface.

This code exports your object to the registry. Its not needed to export your object if you are implementing the interface and binding the object both in the same class.In case you use a different class to bind the object you need to export the object as well.

rgksugan