Tag: 安全策略

RMI无法连接到远程服务器

我最近一直在使用RMI,当我设法让它在locahost工作时,我在尝试使用远程服务器时遇到了各种各样的问题。 这是我正在尝试运行的基本代码: 服务器: public class RmiServer extends UnicastRemoteObject implements RmiServerIntf { public static final String MESSAGE = “Hello world”; public RmiServer() throws RemoteException { } public String getMessage() { return MESSAGE; } public static void main(String args[]) { System.out.println(“RMI server started”); if (System.getSecurityManager() == null) { System.setSecurityManager(new RMISecurityManager()); System.out.println(“Security manager installed.”); } else { System.out.println(“Security […]