• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI access denied

 
Niko Prinz
Greenhorn
Posts: 15
Eclipse IDE PHP Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 !!! ^^
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15356
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic