|
|
We can either run the program in our IDE, or we can run it from the command
line.
-
From the command line...
-
First, we need to start the RMI registry
start rmiregistry
This will open the rmiregistry in a new window.
-
Next, let's start the server.
start ChatServer (or start ChatImpl if we use the
NetBeans unified server).
-
Start the client as you normally would. Make sure that the RMISecurityManager
is included if you do not have all of the server objects locally.
-
So, we'll need a policy file. Make one that has these contents:
grant {
permission java.net.SocketPermission "*:1024-65535", "connect";
};
-
Then, add this line to the client to read the policy information.
System.setProperty("java.security.policy", "client.policy");
-
Or specify the policy with the -D option we discussed in the security
slides.
Making our Client in Sun ONE
|