Start New Discussion within our Software Development Community

hi all
i have start working on java rmi currently.i using this tutorial to write my first java rmi program.

i started the rmiregistry.then i compile server file and generate the stub file using rmic.Now when i am running the server using java command it is giving following exception

Exception in thread "main" access denied ( connect,resolve)
at java.lang.SecurityManager.checkPermission(
at java.lang.SecurityManager.checkConnect(
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(
at sun.rmi.transport.tcp.TCPChannel.createConnection(
at sun.rmi.transport.tcp.TCPChannel.newConnection(
at sun.rmi.server.UnicastRef.newCall(
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at java.rmi.Naming.bind(
at PowerServiceServer.main(

please help me out of this.

Do you have the appropriate permissions for creating a server socket on your machine? Are you the administrator? Have you made any changes to your default policy file?

Also, it seems you are using a very old tutorial. You don't need a "rmic" compiler these days. Read the official RMI tutorial and post if you are facing any issues.

This article has been dead for over six months. Start a new discussion instead.