一个关于RMI的问题

03-11-07 wwlhp@jdon.com
请问用于命名服务的rmi registry和用于动态类加载的web server之间有什么关系?

Java tutorial上说,

Before starting the compute engine, you need to start RMI's registry, using the rmiregistry command. As discussed earlier, the RMI registry is a simple server-side bootstrap naming facility that allows remote clients to get a reference to a remote object. Note that before you start the rmiregistry, you must make sure that the shell or window in which you will run rmiregistry either has no CLASSPATH environment variable set or has a CLASSPATH environment variable that does not include the path to any classes, including the stubs for your remote object implementation classes, that you want downloaded to clients of your remote objects.

If you do start the rmiregistry and it can find your stub classes in CLASSPATH, it will not remember that the loaded stub class can be loaded from your server's code base, specified by the java.rmi.server.codebase property when you started up your server application. Therefore, the rmiregistry will not convey to clients the true code base associated with the stub class and, consequently, your clients will not be able to locate and to load the stub class or other server-side classes.

但是我看不懂。谁能给我解释一下,多谢了!Java tutorial关于rmi的最开始一页有一张图片,但是图片无法上传。

banq
2003-11-07 17:21
你编写了一个RMI Server, R启动这个Server同时,启动RMI registry ,这样相当于有个JNDI 名称,这样client寻找这个Server时,首先查询JNDI就可以了。

没什么原理,就类比,开了一个网站,但是你需要在域名注册中心注册解析你这个网站域名,这样,客户端才能通过域名解析访问到你的网站,道路是一个样。

猜你喜欢