Home > Articles > Programming > Java

J2EE EJB Configuration and Deployment

  • Print
  • + Share This
Java 2 platform, Enterprise Edition (J2EE) enterprise applications are comprised of one or more individual J2EE modules. J2EE modules have deployment descriptors specific to the module type, and J2EE enterprise applications have their own deployment descriptor format. In this article, author Paul Perrone introduces the EJB application module deployment descriptor and covers the basics of EJB deployment descriptors, deployed archives, and deployment procedures.
This article contains excerpts from Building Java Enterprise Systems with J2EE.
From the author of

EJB Deployment Descriptor Top-Level Elements

Java 2 platform, Enterprise Edition (J2EE) enterprise applications are made up of one or more individual J2EE modules. J2EE modules have deployment descriptors specific to the module type, and J2EE enterprise applications also have their own deployment descriptor format.

J2EE EJB application module deployment descriptors are defined in XML files named ejb-jar.xml. Throughout this series of articles, I describe elements of the EJB deployment descriptor as they become relevant to the topic at hand. I thus carve out pieces of the XML EJB module and describe them as the elements they define become relevant. If you are new to XML and XML DTDs, I encourage you to review the basics of XML and DTD structure now. At the very least, I will provide examples of what XML files that adhere to the DTD schema specifications should look like.

The top-level elements of an EJB deployment descriptor, shown in Listing 1, are elements used to define EJB application metadata, EJB structure, assembly information, and the archive filename for any EJB client files. EJB application module deployment descriptors defined according to such a format must also include a standard DOCTYPE definition referencing the standard DTD. The basic top-level structure of an EJB deployment descriptor thus follows the sample form in Listing 1.

Listing 1 EJB DTD Top-Level Elements

<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//
[ic:ccc]DTD Enterprise JavaBeans 1.1//EN" 
[ic:ccc] "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">

<ejb-jar>
 <description> This is my BeeShirts.com EJB Application </description>
 <display-name> BeeShirts.com Application Service </display-name>
 <small-icon> beeshirtsSmall.jpg </small-icon>
 <large-icon> beeshirtsLarge.jpg </large-icon>
 <enterprise-beans>
  <session> ... </session>
  <session> ... </session>
  <entity> ... </entity>
  <entity> ... </entity>
   ...
 </enterprise-beans>
 <assembly-descriptor>
  ...
 </assembly-descriptor>
 <ejb-client-jar> beeshirtsClient.jar </ejb-client-jar>
</ejb-jar>
  • + Share This
  • 🔖 Save To Your Account