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.

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_HOMEenvironment variable must point to where your JDK is installed.The
JBOSS_HOMEenvironment variable must point to where JBoss ...