| Author |
RMI access denied
|
Niko Prinz
Greenhorn
Joined: Aug 16, 2012
Posts: 15
|
|
Heey guys
I have just start to use RMI and a get a some kind of a strange error
java.security.AccessControlException: access denied ("java.net.SocketPermission" "NK" "resolve")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at java.net.InetSocketAddress.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at EnterpriseProgramming.DisplayPerfectTime.main(DisplayPerfectTime.java:8)
Here is my code
can some one plzz help me to find the error thanks !!! ^^
|
Regards,
Niko
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12929
|
|
That code is for the server part. You also have a class DisplayPerfectTime, which is the client part, which you didn't show us.
Are you running the client in an applet, or another environment which has restrictions? Applets run in a secure environment and can't do things like communicate over the network to any arbitrary server, or read and write files from and to the local filesystem.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: RMI access denied
|
|
|