Is it necessary/important to set a classpath in the RMI registry?

落花浮王杯 提交于 2019-12-31 01:57:25

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/20967220/is-it-necessary-important-to-set-a-classpath-in-the-rmi-registry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!