JHU Object-Oriented Software Engineering Course Homepage
Copy Necessary Dependencies
Table of Contents

Deploy the Enterprise Application


6. Configure Project Dependencies

The dependencies for a three-tier J2EE application are laid out in a fashion represented by the following diagram:

VOs Presentation
Application
Persistence

The presentation layer relies on the application layer, which in turn relies on the persistence layer. We have created a fourth project for storing the value objects - those objects which hold our application's actual data - and all three of the layers will rely on this fourth project. We must now inform Eclipse about these dependencies as well as the dependencies on the Spring and MySQL libraries.

In the Project Properties for the data project, navigate to the Deployment Assembly window. This is the point of control for how the web application will be deployed. Click on the Manifest Entries tab to decide which of the EAR resources your project will require.

Clicking the Add button will list the libraries which were copied into the EarContent folder of the EAR project. Using the multi-select controls of your operating system (typically holding control while clicking), select the following entries:

Because this project represents the persistence layer, it should never need the Spring web module. We are avoiding using it here to prevent accidental reference.

Now press the Finish button. The manifest entries have been added to the Manifest Entries pane.

Press OK to dismiss the data project properties dialog. Open the application project properties dialog and again navigate to the deployment assembly pane. Click the Manifest Entries tab as you did before. This time, select the following resources:

Do not add the MySQL connector library; the application logic layer never has need to communicate directly with a MySQL database. Your application project's manifest entries will look like the following one.

Press OK to dismiss the application project's properties dialog. Now open the web project's properties dialog and once again navigate to the deployment assembly pane. Click the Manifest Entries tab. This time, we will be adding the following dependencies:

Note: Normally, we would not need to add the data JAR to the web project; the web project should never need to communicate with the data project since it should always pass through the application logic first. The above configuration works around an apparent bug in the Spring 3.0.6 auto-wiring annotations which prevent the @Autowired annotation from working in the data project unless it is on the web module's classpath.

Again, do not add the MySQL connector library. Your web project's manifest entries pane should resemble the one below.

Press OK to dismiss the dialog. Your projects are now configured in Eclipse correctly.


Copy Necessary Dependencies
Table of Contents

Deploy the Enterprise Application

Written by Zachary Palmer with help from Varun Sharma. Corrections and suggestions are welcome; please e-mail zachary dot palmer xX att Xx jhu.edu