# Problem mit RMISecurityManager ?



## knopper (25. Nov 2004)

Hallo,

Wenn Ich RMISecurity einfüge 

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

bekomme ich. 


java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
	at java.security.AccessController.checkPermission(AccessController.java:401)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
	at java.lang.SecurityManager.checkConnect(SecurityManager.java:1026)
	at java.net.Socket.connect(Socket.java:446)
	at java.net.Socket.connect(Socket.java:402)
	at java.net.Socket.<init>(Socket.java:309)
	at java.net.Socket.<init>(Socket.java:124)
	at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
	at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
	at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
	at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
	at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
	at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
	at java.rmi.Naming.rebind(Naming.java:160)
	at RMIThread.run(MipClientManager.java:578)


Was muss ich nun machen ?


Gruss


----------



## knopper (25. Nov 2004)

Beim Ausführen von RMI Client bekomme ich:

Remote object threw exception java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.lang.ClassNotFoundException: MMImpl_Stub (no security manager: RMI class loader disabled)

Woran liegt das ?

gruss


----------



## Guest (25. Nov 2004)

Dir fehlt noch clientseitig eine *.policy Datei.
z.B. mit folgenden Inhalt
	
	
	
	





```
grant {
  // Alles zulassen!!!
  permission java.security.AllPermission;
};
```
und beim Aufruf

java -Djava.security.policy=./dateiname.policy ....


----------



## knopper (25. Nov 2004)

Danke schön ! 
Es funzt jetzt alles


----------

