Move the files to the deployment directory

Move the "Server" directory into the web documents directory of the web server (JavaWebServer\public_html\).

 

Starting the Java Web Server

c:\JavaWebServer\bin>httpd.exe

 

Starting the Registry Service

Open a new window. Change to a directory that contains no class files. Make sure that the class path is not set to anything. If the rmiregistry finds stub classes in its local CLASSPATH, it will ignore the server(s) java.rmi.server.codebase property, and as a result, your clients will not be able to download the stub classes.

To start rmiregistry:

c:\> start rmiregistry
or
c:\>rmiregistry

 

Starting the Server Application

When starting the server, the java.rmi.server.codebase property must be specified, so that the stub class can be dynamically downloaded to the registry and then to the client. The following command shows how to start the InfoServerImpl server, specifying the java.rmi.server.codebase.

c:\JavaWebServer\public_html\Server> java

-Djava.rmi.server.codebase=http://localhost:8080/Server/ InfoServerImpl


Warning

You must give a space just after the word "java" and just before the word "InfoServerImpl".


If the server is successfully started, it will print the messages "Creating server object" and "server is ready". You can view the RunServer.bat file in the Standalone directory to get help.


Run the Client Application

c:\Client>java -Djava.security.policy=policy.txt InfoClient

Figure 5.4

Well, after going through the above material you definitely deserve some food and drinks.So, take a break because you really deserve it. I will see you at the next section when you are ready.

 

 

 

RMI BOOK MAIN PAGE                Top

  
Copyright © 2001 www.universalteacher.com