Enterprise Java Development@TOPIC@

Chapter 60. Getting Started

60.1. Start the Application Server
60.2. Build Solution
60.3. Build Exercise
60.4. Import Exercise into IDE
60.5. Summary

In this section of the lab we will be getting the environment ready and getting you familiar with the modules you will be working with.

Start off by building the solution to verify the environment os setup correctly.

Now build the starting point for the exercise. Many things have been turned off but it should build successfully.

Import the jpatickets-labex module and its children into your IDE to begin the changes to the exercise. The following shows the source trees for the modules you will be working with.

The overall project is a six (6) module project with one(1) parent and five (5) child modules; impl, ejb, ear, war, and test.


The Impl module provides the business objects (BOs), data access objects (DAOs), and business logic for the application. The BOs are mapped to the database using JPA, the DAOs implement the details of accessing the BOs in the database. The business logic handles any logic issues above the data tier (minimal in this case). The impl module contains a JPA persistence unit and test infrastructure that we will want to use for reference when deploying one to the server-side. There are two main interfaces to the business logic; VenueMgmt and EventMgmt. The EJB tier simply needs to instantiate this logic, inject the objects with required resource dependencies (i.e., a persistence context/EntityManager), provide remote and local access, and define transaction semantics to the container. You will not need to modify this module during the exercise but may be asked to look through it.


The EJB contains two primary EJBs for the exercise (VenueMgmtEJB and EventMgmtEJB) and a third/fourth EJB we will not address (TicketsInitEJB and TicketsInitTxEJB). I refer to it as a third/fourth EJB because logically "TickitInit" is one logical EJB that has been split into two physical EJBs. TicketInitEJB is the remote facade for IT clients to initiate a DB reset. TicketInitTxEJB is an EJB that wraps drop() and create() schema into separate transactions. It happens to use BEAN managed transactions for those actions. You will primarily be working with the VenueMgmt and EventMgmt EJBs and the persistence unit that will be defined in META-INF/persistence.xml


The EAR module contains no source other than a pom.xml. It is exclusively used to deploy the EJB to the server with its Impl module dependency. When identifying the entity classes in the EAR-deployed EJB persistence.xml as a "jar-file", it will be important to know the path of the Impl module within the EAR.


The WAR module is provide to demonstrate persistent unit deployment through an imported EJB and an embedded persistence.xml. It is strictly being used as a deployment platform and does not container a user interface.


The RMI IT Test module is used to deploy the EAR and WAR and initiate tests within the exercise. When you start the exercise most/all of the @Tests have been deactivated with an @Ignore. You will turn them on to expose issues with the implementation and then implement a fix. At the end of the exercise all @Tests should be enabled and passing.


During this setup you started you