Exercise Code Setup and Configuration

You can download the example code for the exercises from http://www.oreilly.com/catalog/entjbeans4/workbooks/index.html. Exercises that require a database will use JBoss’s default embedded database. Consequently, no additional database setup is required. This workbook includes an Appendix that shows you how to configure JBoss to use a different database, if you want to.

Exercises Directory Structure

The example code is organized as a set of directories, one for each exercise (Figure 21-5). You’ll find the code of each exercise in the src/main subdirectory and the configuration files in src/resources.

Exercises directory structure

Figure 21-5. Exercises directory structure

To build and run the exercises, you’ll use the Ant tool. A build.xml is provided for each exercise. It contains the Ant configuration needed to compile the classes, build the EJB JAR, deploy it to JBoss, and run the client test applications. For this reason, the Ant tool is provided with the exercises and can be found in the ant directory.

Tip

You can find out more about Ant at the Apache Jakarta web site http://jakarta.apache.org/ant/.

Environment Setup

For the Ant scripts to work correctly, first set some environment variables in the shells you will use to run the exercises:

  • The JAVA_HOME environment variable must point to where your JDK is installed.

  • The JBOSS_HOME environment variable must point to where ...

Get Enterprise JavaBeans, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.