I try to run the following code:
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
public class CountRMIServer
{
public static void main(String args[])
{
System.setSecurityManager(new RMISecurityManager());
try
{
CountRMIImpl myCount = new CountRMIImpl("my CountRMI");
System.out.println("CountRMI Server Ready");
}
catch (Exception e)
{
System.out.println("Exception: " + e.getMessage());
e.printStackTrace();
}
}
}
If I start the CountRMI Server after I generate the skeleton and start the
RMIRegistry I receive the following error:
Exception: access denied (java.net.SocketPermission 127.0.0.1:1099
connect,resolve)
java.security.AccessControlException: access denied
(java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
:272)
at
java.security.AccessController.checkPermission(AccessController.java:399)
at
java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1044)
at java.net.Socket.<init>(Socket.java:262)
at java.net.Socket.<init>(Socket.java:100)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketF
actory.java:25)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketF
actory.java:120)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
at
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190)
at
sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at CountRMIImpl.<init>(CountRMIImpl.java:13)
at CountRMIServer.main(CountRMIServer.java:12)
CountRMI Server Ready
What is wrong or what have I to do?
Thanks,
Michael
--
Best Regards,
Hyuck Han
"Michael Schneider" <michael....@baumgarten.de> wrote in message
news:b27p8u$d84$06$1...@news.t-online.com...