how to create a RMI/JRMP service

I created a construct of my RMI/JRMP following the example: ClientReceiver, Customer, QueryServer, ClientReceiverImplementation, CustomerImplementation, QueryServerImplementation, and so on. then i made the stub and skeleton(rmic -d ...). compilation is right too, but i got the error at " Naming.rebind("localhost:8088/hello", queryserverImpl)", failure as follow:

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(RMIDirectSocketFactory.java:25)

at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.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 zyz.rmi.queryservicejrmp.QueryServerImplementation.main(QueryServerImplementation.java:157)

can help me ?

[1676 byte] By [winston98] at [2007-9-27 0:14:04]
# 1
Hi,You may configure the following code in your rmi.policy filewhich is passed into the rmi code by -Djava.security.policy=rmi.policypermission java.net.SocketPermission "localhost", "accept,connect,resolve"good luck,Alfred Wu
kib63613 at 2007-7-4 15:15:22 > top of Java-index,Core,Core APIs...
# 2

Either grant AllPermissions in your policy file or the specific permissions you ought to mention over there.

There are a no. of permissions that can be mentioned in your permission file. The general idea is that you supply your application in a signed JAR file as a code aource and supply a policy file which contains protection domain for that code source, listing the permissions granted to the application.

Use java.security.debug=access to discover which permission your application needs

nome02 at 2007-7-4 15:15:22 > top of Java-index,Core,Core APIs...