You can specify your port when exporting a remote object, either through super (port, ...) or exportObject (remote, port, ...) depending on whether you are using or not distributing UnicastRemoteObject. If you renew Activatable, there are similar super () overloads with a port number. You can specify the registry port on the command line if you use it, otherwise through LocateRegistry.createRegistry () if you use this.
Ejp
source share