CORBA 2.6 Getting Started Guide for Java

compile the programs. During the compilation, the Java compiler uses the NonStop CORBA
implementation files in the $NSD_ROOT/lib/jorb.jar file.
Configuring NonStop CORBA for the Stack
Example
Before you can run the Stack example, you must update the configuration database by adding an entity
and several key-value pairs, but only after you have installed and configured NonStop CORBA.
To update the configuration database for the Stack example, add the tcp_server entity to the
NonStop CORBA configuration database by entering:
entityaddkeyvalue tcp_server@ORB tcp_server true
entityaddkeyvalue tcp_server@ORB port_number 0
entityaddkeyvalue tcp_server@ORB host_name nnn.nnn.nnn.nnn
Note that in setting the host name you can enter either a host name or an IP address.
Running the Stack Example on OSS
The Stack example is now ready to run. If your NonStop CORBA system is not already running, you
must start it by using the Console or the nsdstart script.
To run the Stack example, open two OSS windows. In each window, navigate to the directory where the
Stack example was built, javasamples/stack. Also, make sure that each window has the correct
environment setup, which is obtained by sourcing in the env.sh script.
In one window, start the server program by using the following command:
java Server -ORBprofile tcp_server
In the other window, start the client program by using the following command:
java Client -ORBprofile tcp_client
When you run the client, you will see the following output in its window:
Top: 100
Top: 200
Top: 300
Top: 400
Top: 500
Top: 600
Top: 700
Top: 800
Top: 900
Top: 1000
Got STACK_OVERFLOW exception as expected.
Pop: 1000