Home > Articles > Programming > Java

  • Print
  • + Share This
From the author of

Session Bean Configuration and Deployment

In the last article, I introduced the basic top-level structure of an EJB application module deployment descriptor. The root <ejb-jar> element contained an <enterprise-beans> element, which could contain a collection of <session> elements. Each <session> element is used to describe the configuration and deployment of an individual session bean.

The <session> bean element, shown in Listing 2, defines session bean metadata, a unique name in the EJB JAR file, the bean's class and interface names, the type of session bean, configuration parameters, references to other EJBs and database connections, security semantics, and a transaction flag. The session-related elements of an example stateful session bean's ejb-jar.xml file are shown in Listing 2. You'll note that in addition to standard metadata and structural information about the EJB, it has defined <ejb-ref> elements for all the EJBs that it accesses as a client to those beans.

Listing 2 Example of EJB Session Bean Deployment Descriptor Information

<?xml version="1.0" encoding="UTF-8"?>

<!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'>

 <description>A wacky example</description>

Vendor-specific deployment descriptor files to configure and deploy session beans are also needed. Developers most often use GUI-based deployment tools provided by vendors to develop such files.

  • + Share This
  • 🔖 Save To Your Account