내가 자바 RMI와 클라이언트 - 서버 프로그램을 쓰고 있어요 내가 오류를 받고 있어요 거부 :자바 RMI java.security.AccessControlException : 액세스
java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:1099" "connect,resolve")
내 코드는 다음과 같습니다
package xxx;
import java.rmi.Naming;
import java.rmi.RemoteException;
public class Server extends Engine implements RemoteInterface {
public Server() {
super();
if(System.getSecurityManager() == null) {
System.setSecurityManager(new SecurityManager());
}
try {
Naming.rebind("Test", this);
System.out.println("Bound in registry!");
} catch(Exception ex) {
System.out.println(ex);
}
}
@Override
public void test() throws RemoteException {
System.out.println("test() invoked");
}
}
무엇이 잘못 되었나요?
다른 여러 가지를 잊어 버렸습니다. 이러한 누락으로 인해이 문제가 발생하지 않습니다. – EJP
글쎄, 문제를 해결하는 사람들을 추가하기 때문에 잘못된 것입니다. – MikkoP
그 문제를 해결할 수있는 유일한 방법은 SecurityManager를 제거하거나 .policy 파일을 수정하는 것입니다. – EJP