J2EE deployment descriptors

 
 
Every J2EE application module must include an XML based deployment descriptor that provide configuration information for the asset as well as defining relationships to other components.

There are two types of deployments descriptors:
  • vendor neutral deployment descriptors (a.k.a deployment descriptors)
  • vendor specific deployment descriptor (a.k.a deployment plans)
Deployment descriptors are necessary but are not always sufficient to deploy an asset on your server.
Deployment plans provides additional information to map declared resources names, ejb names, security roles, JMS roles (if any) to actual resources in the server. The deployment plans also contain specific server settings and configurations.







Explain application.xml based on application_1_3.dtd (J2EE 1.3)

Show a valid application.xml file.

Occurrence of an element (column #) meaning:

1 = must occur one time
? = must occur zero or 1 time
+ = must occur one or more times
* = must occur zero or more times

Note:
a | b means either a or b


Information

Element#Description
application 1 The application element is the root element of a J2EE application deployment descriptor.
  icon ? Contains small-icon and large-icon elements that specify the file names for small and a large GIF or JPEG icon images used to represent the parent element in a GUI tool.
    small-icon ? Specify the file name for a small (16 x 16) GIF or JPEG icon image used to represent the parent element in a GUI tool.

The file name is a relative path within the application's ear file.

Example:

<small-icon>employee-service-icon16x16.jpg</small-icon>
    large-icon ? Specify the file name for a large (32 x 32) GIF or JPEG icon image used to represent the parent element in a GUI tool.

The file name is a relative path within the application's ear file.

Example:

<large-icon>employee-service-icon32x32.jpg</large-icon>
  display-name ? The display-name element contains a short name that is intended to be displayed by tools. The display name need not be unique.

Example:

<display-name>Employee Self Service</display-name>
  description ? The description element is used to provide text describing the parent element. The description element should include any information that the application ear file producer wants to provide to the consumer of the application ear file (i.e., to the Deployer). Typically, the tools used by the application ear file consumer will display the description when processing the parent element that contains the description.
  module + The module element represents a single J2EE module and contains a connector, ejb, java, or web element, which indicates the module type and contains a path to the module file, and an optional alt-dd element, which specifies an optional URI to the post-assembly version of the deployment descriptor.

The application deployment descriptor must have one module element for each J2EE module in the application package.
    connector | ejb | java | web 1 The connector element specifies the URI of a resource adapter archive file, relative to the top level of the application package.

The ejb element specifies the URI of an ejb-jar, relative to the top level of the application package.

The java element specifies the URI of a java application client module, relative to the top level of the application package.

The web element contains the web-uri and context-root of a web application module.
      web-uri 1 Only if the parent element is web, this element applies.

The web-uri element specifies the URI of a web application file, relative to the top level of the application package.
      context-root 1 Only if the parent element is web, this element applies.

The context-root element specifies the context root of a web application.
    alt-dd ? The alt-dd element specifies an optional URI to the post-assembly version of the deployment descriptor file for a particular J2EE module. The URI must specify the full pathname of the deployment descriptor file relative to the application's root directory. If alt-dd is not specified, the deployer must read the deployment descriptor from the default location and file name required by the respective component specification.
  security-role * The security-role element contains the definition of a security role. The definition consists of an optional description of the security role, and the security role name.

Example:

<security-role>
   <description>
      This role includes all employees who are authorized
      to access the employee service application.
   </description>
   <role-name>employee</role-name>
</security-role>
    description ? The description element is used to provide text describing the parent element. The description element should include any information that the application ear file producer wants to provide to the consumer of the application ear file (i.e., to the Deployer). Typically, the tools used by the application ear file consumer will display the description when processing the parent element that contains the description.
    role-name 1 The role-name element contains the name of a security role.

The name must conform to the lexical rules for an NMTOKEN.