SourceForge.net Logo

About the Labs

This tutorial is based on a set of labs that illustrate the topics discussed in this tutorial. The labs enable you to practice what you have learnt so far and to compare your work with provided lab solutions. See Lab Overview for a list of available labs and the topics that they try to illustrate.

Prerequisites for the Labs

To understand the examples, you will need a good knowledge of the Java programming language. To understand the deployment of an openMDX provider in an Enterprise JavaBeansT container, you need some basic knowledge about Enterprise JavaBeans (especially session bean and deployment topics).

Downloading the Labs

If you are viewing this online and you want to build and run the labs, you need to download the lab bundle from SourceForge.net. Once you have unzipped the lab distribution, the lab source code is in the openmdx-example-lab/src directory and the lab UML model is in the openmdx-example-lab/models directory.

Do not unzip the lab distribution into a directory which has spaces in its path name!

How to build the Labs

To build and run the labs you need a copy of the Java 2 Platform, Standard Edition (J2SE ) SDK 1.3.1. You can download the J2SE 1.3.1 from http://java.sun.com/j2se/1.3/.

Please note that openMDX is tested with J2SE 1.3.

The examples are distributed with a configuration file for version 1.6 of Ant, a Java-based build tool. The Ant utility is hosted by the Jakarta project at the Apache Software Foundation. You can download Ant from http://ant.apache.org/.

To build the labs, follow these steps:

  1. Download and install the J2SE SDK 1.3.1 and Ant.

  2. The installation instructions for the J2SE SDK and Ant explain how to set the required environment variables. Verify that the environment variables have been set to the values noted in the following table.

    Table 1-1. Settings for Environment Variables

    Environment Variable

    Value

    JAVA_HOME

    The location of the J2SE SDK installation.

    ANT_HOME

    The location of the Ant installation.

    PATH

    Should include the bin directories of the J2SE SDK and Ant installations.

  3. Go to the openmdx-example-lab directory.

  4. Execute ant all to build all the labs. The build process deposits the output into the directory openmdx-example-lab/build.

The specific lab requirements to access a relational database or to deploy a provider in an Enterprise JavaBeans container are mentioned in the corresponding chapters later on.

How to run the Labs

Please make sure that your system meets the prerequisites mentioned in the previous section and that you have built the labs.

For almost every lab there are two copies:

  • The work copy contains an incomplete example which has to be completed. Sometimes a class is incomplete and sometimes even whole classes are missing. This is intended to be the place for you to practice.

  • The solution copy contains the full working example which serves as the solution.

To run the labs, follow these steps:

  1. Go to the openmdx-example-lab directory.

  2. Execute ant -f run.xml. This will display the provided Ant targets to run the labs. For almost all the labs there are two targets available. You can run the work copy (all work copy targets end with Work) or the solution (all solution targets end with Solution).

  3. Execute ant -f run.xml <myLab> to run the desired lab, e.g. ant -f run.xml clientTypedSolution.