我有两个通过RMI相互通信的服务器。我试图在localhost上测试,但是抛出了这个错误。我尝试使用System.setProperty("java.rmi.server.hostname", IP);和System.setProperty("java.rmi.server.hostnameat sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.U
这是我第一次使用RMI,基本上我设法在我的PC上本地运行以下RMI示例,而不是通过两台独立的Linux计算机。Exception {
// ... and bind it with the RMI为了运行rmi示例,我执行了以下操作:2)运行rmiregisrty4)将存根从服务器端复制到客户端,并将其复制到相同的包中