4

Is it necessary or important to set a class path in the registry for RMI to work correctly?

08Dc91wk
  • 4,254
  • 8
  • 34
  • 67
  • http://stackoverflow.com/questions/9440619/how-do-i-set-the-classpath-that-rmiregistry-uses – AJ. Jan 07 '14 at 08:50
  • well, if you are right then thank you a lot! But nonetheless I just want to hear the others what they know ;-) –  Jan 07 '14 at 08:52

1 Answers1

4

Contrary to @Rahul's baseless assertion, it is indeed necessary to set a CLASSPATH for the RMI Registry, unless:

  1. You are starting the Registry from a directory which is also the head of a package structure of .class files.
  2. You are using the codebase feature, or
  3. You are starting the Registry in the same JVM as your RMI remote obects, via LocateRegistry.createRegistry().

If you don't do one of these four things, you will get a ServerException wrapping a ClassNotFoundException when you bind your remote object(s) to the Registry.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • 1
    Oh awesome! I really don't know what to say. Thank you very much. You really helped me a lot. –  Jan 07 '14 at 09:32