java – rmi注册表绑定问题

我在IP:192.168.133.2的虚拟机(运行Windows XP)上运行RMI Regitry
并尝试绑定RMI服务器(在不同的vm XP IP上运行:192.168.133.3)
使用此代码:

Naming.rebind("//192.168.133.2/rmi.2", new RMI());

哪里

public class RMI extends UnicastRemoteObject

但我得到这个例外:

    java.rmi.AccessException: Registry.Registry.rebind disallowed; origin /192.168.133.3 is non-local host

我认为RMI注册表不接受任何没有运行的rmi服务器
RMI注册表运行机器.

但如何使这个注册表接受我的rmi服务器?

p.s:我正在使用JBuilder X作为IDE.

I’m trying to implement a mobile agent which will run on some rmi servers to do some work on them and return the results to the starting station so RMI servers implements the environment that hosts this agent to do its work and send it to the next station which it’ll locate through the registry

解决方法:

trying to bind an RMI server (running on different vm XP IP: 192.168.133.3)

停在那儿.你不能这样做.您只能将RMI服务器绑定到与执行绑定的代理程序在同一主机中运行的注册表.

请注意,这并不一定意味着与远程对象本身运行的主机相同.例如,客户端可以查找远程注册表并将检索到的存根绑定到本地注册表.但是您无法将任何内容绑定到远程注册表.

上一篇:java – 我怎样才能保证发送“保持活着”的心跳?


下一篇:删除Docker容器镜像的方法