Viewing deployment descriptors
A deployment descriptor is an extensible markup language (XML) file that specifies configuration and container options for an application or module.
Before you begin
This topic assumes that you have installed an application or module on a server and that you want to view its deployment descriptor.
About this task
When you create a Java™ 2 Platform, Enterprise Edition (J2EE) application or module in an assembly tool, the assembly tool creates deployment descriptor files for the application or module. Java Platform, Enterprise Edition (Java EE) 5 or later applications and modules might use annotations instead of deployment descriptors.
After an application or module is installed on a server, you can view its deployment descriptor in the administrative console. You cannot view Java EE 5 or later annotations.
Unless an application supports Java EE 5 or later, an enterprise archive (EAR) file must contain an application.xml file. The application.xml identifies each module of an application. A Java EE 5 application is not required to provide an application.xml file in the EAR file. When an application.xml file does not exist, the product examines the Java archive (JAR) file contents to determine whether the JAR file is an enterprise bean (EJB) module or an application client module. A JAR file should not contain more than one deployment descriptor in it. When an ejb-jar.xml file is found in a JAR file, the product considers it an EJB module. If an ejb-jar.xml file is not found and an application-client.xml is found, the product considers the JAR file to be an application client module. If both ejb-jar.xml and application-client.xml files exist in the JAR file, the product might consider a JAR file intended to be an application client module to be an EJB module or a JAR file intended to be an EJB module to be an application client module. A JAR file should not contain more than one kind of deployment descriptor.
Procedure
Results
The deployment descriptor for the application or module is displayed.
Example
The deployment descriptor for the product DefaultApplication follows:
<application version="6" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" >
<description> This is the IBM WebSphere Application Server Default Application.</description>
<display-name> DefaultApplication.ear</display-name>
<initialize-in-order> False</initialize-in-order>
<module id="WebModule_1" >
<web>
<web-uri> DefaultWebApplication.war</web-uri>
<context-root> /</context-root>
</web>
</module>
<security-role id="SecurityRole_1" >
<description> All Authenticated users role.</description>
<role-name> All Role</role-name>
</security-role>
</application>
DefaultApplication
contained
Increment.jar with an entity EJB and had a different deployment
descriptor:<application id="Application_ID" >
<display-name> DefaultApplication.ear</display-name>
<description> This is the IBM WebSphere Application Server Default Application.</<description>
<module id="WebModule_1" >
<web>
<web-uri> DefaultWebApplication.war</web-uri>
<context-root> /</context-root>
</web>
</module>
<module id="EjbModule_1" >
<ejb> Increment.jar</ejb>
</module>
<security-role id="SecurityRole_1204342979281" >
<description> All Authenticated users role.</description>
<role-name> All Role</role-name>
</security-role>
</application>
What to do next
After displaying a deployment descriptor on the console page, do the following:
- Examine the deployment descriptor contents, including any configurations
that it has for application bindings, security roles, references to
other resources, or Java Naming and Directory Interface (JNDI) names.
For example, examine the JAR files of your Java EE 5 or later module to ensure that each JAR file does not contain more than one kind of deployment descriptor. If a JAR file contains more than one kind of deployment descriptor, proceed to the next step and remove the extraneous deployment descriptor. Thus, if both ejb-jar.xml and application-client.xml files exist in a JAR file, remove the deployment descriptor that your module does not need.
- Change a deployment descriptor as needed.
You can edit a deployment descriptor file manually. However, it is preferable to edit a deployment descriptor using the console or in an assembly tool deployment descriptor editor to ensure that the deployment descriptor has valid properties and that its references contain appropriate values.
If your Java EE 5 or later module does not have a metadata-complete
attribute
or the metadata-complete
attribute is set to false
,
you can instruct the product to write the entire module deployment
descriptor, including deployment information from annotations, to
XML format. On the Metadata for modules page, select metadata-complete
attribute.
metadata-complete
attribute
to true
causes the product to incorrectly represent
an @EJB
annotation in the deployment descriptor as <ejb-ref>
rather
than <ejb-local-ref>
. For web modules, setting
the metadata-complete
attribute to true
might
cause InjectionException errors. If you must set the metadata-complete
attribute
to true
, avoid errors by not using a shared library,
by placing the shared library in either the classes or lib directory
of the application server, or by fully specifying the metadata in
the deployment descriptors.