EJB Deployment   «Prev  Next»

Create Deployable Application Jar File

Lesson 5 Create the deployable application and the jar file
Objective Create an application file and a jar file suitable for deployment of the Hello bean.

Create Deployable Application Jar File

In this lesson, you will be creating the deployment descriptor (DD) and packaging it, together with the bean's class files, in a deployable jar file.
In the J2EE reference implementation the jar file is packaged in an application file.
The deployment descriptor describes the bean and its properties. It is created by the bean developer. To recap, the deployment descriptor contains the following information:
  1. Bean's name
  2. Classes for the bean, home and remote interfaces
  3. The bean's type
  4. For session beans, the management type (stateful/stateless)
  5. Environment entries
  6. Security roles
  7. etc.
The deployment descriptor is an XML file. It is packaged together with the classes for the bean, the home and remote interfaces, plus any other classes the bean requires, in a jar file. The jar file is the deployable unit for the bean. This is illustrated in the diagram below.
Create the deployable jar file
Create the deployable jar file

The DD and the jar file are created using the Java program deploytool that comes with the J2EE platform. Creating Deployable Jar File

Create Deployable Jar File -Exercise

Create Deployable Jar File -Exercise
Now that you have seen the steps to create the application and the deployable jar file, try them yourself in the exercise that follows.
In the next lesson, you will deploy the jar file in the EJB container
Deployable unit: A deployable unit is a jar file for an EJB that contains the bean's class files and the DD used for software distribution.