Despite its simple design, the Hello World program lets you learn and experiment with all the tasks required to develop almost any CORBA program that uses static invocation. To run this client-server application on your development machine:
tnameserv -ORBInitialPort 1050&
From an MS-DOS system prompt (Windows), enter:
start tnameserv -ORBInitialPort 1050
In this example, port 1050 has been chosen for the naming service. You can change this to a different value if port 1050 is occupied on your system. If the nameserverport is not specified, port 900 will be chosen by default. When using Solaris software, you must become root to start a process on a port under 1024. For this reason, we recommend that you use a port number greater than or equal to 1024.
On Unix:
java HelloServer -ORBInitialPort 1050&
On Windows:
start java HelloServer -ORBInitialPort 1050
You can leave out -ORBInitialPort nameserverport if the name server is running on the default port.
If the Hello server is running on a different host (machine) than the naming service, you would need to specify where the naming service is running when you start the server. To do this, you would use the -ORBInitialHost nameserverhost argument.
java HelloClient -ORBInitialPort 1050
You can leave out -ORBInitialPort nameserverport if the name server is running on the default port.
If the Hello client is running on a different host (machine) than the naming service, you would need to specify where the naming service is running when you start the client. To do this, you would use the -ORBInitialHost nameserverhost argument.
Hello world!!
The name server and the Hello World server, like many CORBA servers, run until you explicitly stop them. To avoid having many servers running, kill the server processes after the client application returns successfully.
You can run the applet from either a Java-enabled Web browser (with JRE 1.3) or from the Applet Viewer. In either case, you must run the Name Server and the HelloServer prior to invoking the applet. To run the applet,
On Unix:
tnameserv -ORBInitialPort 1050&
On Windows:
start tnameserv -ORBInitialPort 1050
In this example, the nameserverport, which is the port on which you want the name server to run, is set to 1050. If you do not specify this, port 900 will be chosen by default. Also note that using Solaris software, you must become root to start a process on a port under 1024. For this reason, we recommend that you use a port number greater than or equal to 1024.
On Unix:
java HelloServer -ORBInitialPort 1050 &
On Windows:
start java HelloServer -ORBInitialPort 1050
In this example, the ORBInitialPort, which is the port on which you want the name server to run, is set to 1050. If you do not specify this, port 900 will be chosen by default. Also note that using Solaris software, you must become root to start a process on a port under 1024. For this reason, we recommend that you use a port number greater than or equal to 1024.
To run the applet from the appletviewer,
<path_to_appletviewer_executable>appletviewer Tutorial.html
Hello world!! prints to the appletviewer frame.
To run the applet from a Web browser, make sure you have the Java 2 Runtime Environment, Standard Edition, version 1.3.0, which includes the Java Plugin 1.3, and the latest version of your browser, preferably Netscape 6, then:
Hello world!! prints in the browser frame.
If the applet does not run in the Web browser, make sure you have the Java 2 Runtime Environment, Standard Edition, version 1.3.0, which includes the Java Plugin 1.3. This plugin is needed to run the applet and may not be present in older Web browsers.
The name server and the Hello World server, like many CORBA servers,
run until you explicitly
stop them. To avoid having many servers running, kill the server processes
after the client application returns successfully.
Troubleshooting
Make sure you have the Java 2 Runtime Environment, Standard Edition, version 1.3.0, which includes the Java Plugin 1.3. This plugin is needed to run the applet and may not be present in older Web browsers. It can be downloaded from http://java.sun.com/products/plugin/index.html.
The default ORB Initial Port is port 900. If you prefer, you can omit the port specifications if you start the name server on port 900. Using Solaris software, you must become root to start a process on a port under 1024. Remember to exit from root access before continuing with the tutorial if you choose this port for your name server.
| Home |