If you look at the entire stack trace, which you should have posted in your question, you will probably find that the error occurred in bind() or rebind(). That indicates that the Registry doesn't have the class mentioned on its CLASSPATH.
Solution: either run the Regsistry with an appropriate CLASSPATH, or run it inside the server JVM via LocateRegistry.createRegistry().