A Deployment Checklist for Building Distributed Applications with CORBA and Java

Steps to deploy the Client-Server application are given below. Example used here is the "Count" application that was discussed in class, but these steps apply to other applications as well. Note that these steps assume you are using Visibroker for Java 3.3 (available locally) and JDK 1.1.8 (VBJ 3.3 is not compatible with Java 2 platform). If you use VBJ 4.x (available from Inprise site) and Java 2, there are substantial configuration changes, and the default semantics is based on POA (Portable Object Adapter). However, it is possible to use VBJ 4 with BOA based applications. Some of the changes are discussed at the end of this document, and in class (please also see the documentation for VBJ 4).

  1. Set the PATH variable
  2. PATH=%PATH%;C:\jdk1.1.8\bin;C:\Inprise\vbroker\bin;.

  3. Set the CLASSPATH variable
  4. SET CLASSPATH=%CLASSPATH%; .;C:\jdk1.1.8\lib\classes.zip; C:\Inprise\vbroker\lib\vbjorb.jar; C:\Inprise\vbroker\lib\vbjapp.jar; C:\Inprise\vbroker\lib\vbjtools.jar;C:\Inprise\vbroker\lib\vbjgk.jar;

    You may also add the directory in which your class files for the application will reside, if different from the current directory. The CLASSPATH variable can be set globally (e.g., in the autoexec.bat file for Windows 95/98 systems) or locally using command prompt. It is best to create a batch file that sets up your environment. This can be called each time you start a console window.

    NOTE: If you are using the Visibroker naming service, then you must also include the jar file C:\Inprise\vbroker\lib\vbjcosnm.jar in your CLASSPATH.

  5. On the server, run CountServer
  6. Pre-compile the .idl file
  7. idl2java count.idl -no_comments -no_tie

    As a result of this step, a subdirectory called Counter will be created under your current directory with the necessary .java files. Use -no_comments if you do not want Javadoc documentation in your generated Counter\*.java files. Use -no_tie to avoid generating extra delegation classes (used in the Tie method).

  8. Compile the .java files

vbjc -d C:\classes CountClient.java

vbjc -d C:\classes CountImpl.java

vbjc -d C:\classes CountServer.java

use -d option to indicate where you .class files will be stored (this can be any legal path name). If you are using earlier versions versions of Visibroker (e.g., 3.0/3.1), such as the one that comes with the Orfali and Harkey book, then you can use the command "javac" for compiling the files rather than "vbjc". In fact, you can use "javac" in any case, but the "vbjc" command automatically adds the necessary Visiboker class files as part of compilation (it still uses your installed Java compiler).

After this step, C:\classes will contain the files CountClient.class, CountImpl.class, CountServer.class, and C:\classes\Counter will contain the files _CountImplBase.class, _st_Count.class, Count.class, CountHelper.class. For a description of these files refer to the class notes.

  1. Copy .class files to client and server machines
  2. On the Client Side

    C:\classes\Counter\Count.class

    C:\classes\Counter\_st_Count.class

    C:\classes\Counter\CountHelper.class

    C:\classes\CountClient.class

    On the Server Side

    C:\classes\Counter\Count.class

    C:\classes\Counter\_CountImplBase.class

    C:\classes\CountImpl.class

    C:\classes\CountServer.class

    NOTE: If you used out or inout parameters in your .idl, you will need \classes\Counter\CountHolder.class on both client and server machines. In addition, if you use structured types or exceptions in your IDL interfaces, then additional package directories will be created which you will need to copy to both client and server machines.

  3. On the server:.
  4. First start the Visibroker Smart Agent

    osagent -c

    NOTE: On Windows machines, the Smart Agent can be started using the "start menu". The Smart Agent is a proprietary program which allows for clients to easily find object implementations (using the bind() method) without having to rely on the CORBA naming service or having to convert and pass object references as strings.

    Then run CountServer:

    vbj CountServer OR java CountServer

  5. On the client:
  6. Be sure to set the PATH and CLASSPATH variables as discussed above. Not all the JAR files mentioned above are necessary on the client side, but in case the client machine is used to host other CORBA objects, it would be prudent to include all of them anyway.

    Then run CountClient:

vbj CountClient OR java CountClient

 NOTE: You do not need to login with the same user name on both client and server machines.


Notes on Using Visbroker for Java 4.x

VBJ 4.x provides full compliance with CORBA 2.3 standard, and it replaces the Basic Object Adapter (BOA) with Portable Object Adapter (BOA). The POA offers portability on the server side. Although BOA is being deprecated, VisiBroker 4.0 will still support BOA functionality, however this is no longer the default semantics used by the ORB.

Configuration of VBJ 4.x

The ORB Jar files that must now be included in the CLASSPATH are:

In addition, the Gatekeeper program which comes with the VBJ installation (necessary for deploying CORBA clients as applets) requires the Java Servlet Development Kit (e.g., JSDK 2.2). Surprisingly, this is not included in the Visibroker installation package. It must be downloaded from java.sun.com, and the included file ("servlet.jar") must be placed on the CLASSPATH.

Using BOA with VBJ 4.x

For full details of using BOA with VBJ 4, please read the VBJ 4 Programmer's Guide. Here we discuss the two basic steps required to make most BOA-based applications work with VBJ 4.

Using the POA with VBJ 4.x

We will look at the basic mechanisms for using the POA in programs later. However, the basic steps which distinguish the BOA-based and the POA-based programs are as follows:


Back