Corba with Java   «Prev  Next»

Corba Course Project - Exercise

The course project:

Using JacORB to run the sample project
Objective: Confirm that your installations of JacORB and the JDK are correct.

Exercise scoring

You will receive 1 point for this exercise.The exercise is auto-scored; when you have completed the exercise, click the Submit button to receive full credit.

Background/overview


In this exercise, you will download some files and confirm that you can work with them.

Download files

Download the zip file testinstall.zip and unzip it into an empty directory.

Instructions

Install both JacORB and the JDK and adjust your path variable as explained below. Follow these steps to confirm that your system is configured properly.
  1. Edit the setenv.bat file to reflect your local settings.
  2. From a command prompt, run setenv.bat, then start all.bat to start the servers. Be sure to wait as instructed until each server has emitted a block of output before continuing the batch file.
  3. From that same command prompt, run the client by typing java client.Client
    You should see output like this:

    > java client.Client
    [ New connection to ..... ]
    [ New connection to ..... ]
    [ New connection to ..... ]
    
    There are 10 of Ender's Game in stock. Each costs $10.00
  1. Delete the Client.class file from the client folder. From the command prompt you have been using, compile the client like this: javac client\Client.java
  2. The code should compile without errors. Run it again, as above, to confirm that everything still works.
  3. Delete the BookShopModule folder. This folder contains code that is generated by the IDL compiler. Stop all the servers by pressing Ctrl-C in each server command prompt in turn, replying Y when asked if you wish to stop the batch file, and closing the command prompt. Do not close the command prompt from which you have been starting everything. From this command prompt, compile the IDL: idl Exer1.idl
  1. This will create the BookShopModule folder and fill it with generated Java code. Compile all this Java code from the same command prompt (do not change directories down to the BookShopModule directory): javac BookShopModule\*.java
  1. Having generated and compiled your code, start the servers again with startAll.bat and run the client as before. Everything should continue to work perfectly.
Hints
If any part of this exercise does not work as expected, you must solve the issue before moving on to work with your own code. Some tips:
  1. Make sure that the JacORB bin folder is on your path.
  2. Make sure you have edited jaco.bat and JacORB.properties as instructed earlier.
  3. Make sure setenv.bat is setting classpath and nsfile correctly.
  4. Every time you want to start servers or clients from a new command prompt, run setenv in that command prompt to set the environment variables.
  5. Wait long enough before starting each server. Watch the output of each server to be sure it’s fully started and added to the name server.
  6. If you have been testing repeatedly, try restarting your computer. Windows NT sometimes holds on to resources even after closing a command prompt, so a restart can clear things up.
  7. Try compiling some other Java code you have on your system that has nothing to do with CORBA, to show yourself whether your problems are with Java or JacORB.
Completing your exercise: When you have completed the exercise, click the Submit button.