You need to have a rmiregistry
running before attempting to connect (register) a RMI service with it.
The LocateRegistry.createRegistry(2020)
method call creates and exports a registry on the specified port number.
See the documentation for LocateRegistry