- component's configuration,
- deployment settings of an application, a module, or a component
- of and instructions to the J2EE container.
An enterprise bean module deployment descriptor, for example, declares transaction attributes and security authorizations for an enterprise bean.
Because deployment descriptor information is declarative, it can be changed without modifying the source code. At run time, the J2EE server reads the deployment descriptor and acts upon the component accordingly.
Most J2EE vendors (Application server) provide a GUI tool for generating deployment descriptors and performing deployment because creating manual entries is tedious and error prone.
A Java EE deployment descriptor is defined by a Java EE specification and can be used to configure deployment settings on any Java EE-compliant implementation.
A runtime deployment descriptor is used to configure Java EE implementation-specific parameters.
For example, the GlassFish Server runtime deployment descriptor contains such information as the context root of a web application, as well as GlassFish Server implementation-specific parameters, such as caching directives. The GlassFish Server runtime deployment descriptors are named sun-moduleType.xml and are located in the same META-INF directory as the Java EE deployment descriptor.
The standard Java EE deployment descriptor. The ejb-jar.xml may be used to define EJBs and to specify standard configuration settings for the EJBs. An ejb-jar.xml can specify multiple beans that will be deployed together.
WebLogic Server-specific deployment descriptor that contains elements related to WebLogic Server features such as clustering, caching, and transactions. This file is required if your beans take advantage of WebLogic Server-specific features. Like ejb-jar.xml, weblogic-ejb-jar.xml can specify multiple beans that will be deployed together.
WebLogic Server-specific deployment descriptor that contains elements related to container-managed persistence for entity beans.
In J2EE, a WAR file is typically contained within an EAR file. In the example in the preceding section, the EAR file, J2EEAppName.ear, would have its /META-INF directory at the top level, along with Web module WAR files, EJB module JAR files, client application JAR files, and resource adapter RAR files (zero or more of each, as applicable):
META-INF/ application.xml orion-application.xml (optional) EJBModuleName.jar WebModuleName.war ClientModuleName.jar ResourceAdapterModuleName.rar
The following examples show the structure of the archive files for a simple Web application. The EAR file contains a WAR file, which contains a single servlet.