2009. 8. 18.

JAVA RMI 원격접속

1. RMI Client

Registry reg = LocateRegistry.getRegistry(5555);
ServiceInvoker si = (ServiceInvoker) reg.lookup("Hello");
message = si.sayHello();


2. RMI Server

if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}

Registry registry = LocateRegistry.createRegistry(RMI_PORT);
registry.bind(RMI_SERVICE_NAME, new RmiListener());


3. RMI 서버 자바 실행 옵션
-Djava.security.manager -Djava.security.policy=C:\\develdata\\workspace-jee\\nstprjtest\\server.policy

4. server.policy

grant {
permission java.security.AllPermission;
};

댓글 없음: