5. Deploying a Java Application

Exercise Objectives

The objective of this exercise is to deploy a simple BI Beans Java application using JDeveloper.

Exercise Description

After development, a Java application can be deployed to a production machine. JDeveloper provides deployment tools to help you through this process.

Exercise Tasks

This exercise guides you through the steps that are necessary to deploy your tutorial application.

Ensure that you have JDK 1.3.1 installed on the production machine. The JDK home directory will be referred to as <jdk_home> and the directory where you will run your application will be referred to as <deploy_home>.

Deploy the application

To deploy objects

Before you deploy your application, copy your objects to the BI Beans Catalog, which is a persistent database. For directions, follow the tutorial Copying Objects to the BI Beans Catalog to copy the objects. After the objects are copied, the runtime settings for the application are updated automatically to use the objects in the Catalog at runtime.

You are now ready to edit the deployment profile that was created by the wizard and to create a JAR file for the application.

To edit the deployment profile

  1. In the System-Navigator, right-click bijavaclientarchive1.deploy and select Settings.
  2. Under JAR Options, select Compress Archive.
  3. Under Dependency Analyzer, select BI Beans Runtime, BC4J Runtime, Oracle JDBC, and OLAP API 92. Choose OK to complete the definition of the profile.

To create the JAR file

  1. Right-click the deployment profile that you edited (that is, bijavaclientarchive1.deploy) and choose Deploy to JAR file from the popup menu.

    In JDeveloper, under the Deployment tab, you will see a message that indicates that the deployment to a jar file has begun; this may take several minutes to finish. Wait until you see a message that informs you that the deployment is finished.
  2. The JAR file will be created in the folder that you specified when you created the deployment profile. If you do not remember the directory where you saved the JAR file, you can position the cursor over the deployment profile and a tool tip that contains the location of the JAR file is displayed.

    The JAR file is now ready to be deployed. It contains the application classes and the BIBeans runtime libraries.

  3. Copy the JAR file to <deploy_home> on the production machine.

Start and run the application

To prepare to run the application, ensure that the required OLAP services are available and running.

To run the application

  1. On the production machine, open a command prompt window and ensure that the JDK Runtime Classes (that is, the files in <jdk_home>/jre/lib/rt.jar) are in the CLASSPATH and that the JDK Binaries (that is, the files in<jdk_home>/bin) are in the PATH.
  2. Set the CLASSPATH to include the deployed JAR file. For example:
    set classpath=<deploy_home>/bijavaclientarchive1.jar;%classpath%
  3. To run the application, enter the following command under <deploy_home>:
    java <applicationclassname>
    For example:
    java mypackage1.BIApplication1

After a short time, the application will start.

To reset runtime settings within JDeveloper after deployment

After deployment, you may want to reset the runtime settings so that the application will reference objects locally during development in JDeveloper. To do so, in the System-Navigator pane, right-click the BI Configuration file (for example, Project1BIConfig1.xml) and choose Settings from the popup menu. Select the Use design settings check box and choose OK.

Exercise Summary

You have successfully deployed a simple Java application from JDeveloper.

4. Linking Presentations | Overview