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.







J2EE deployment descriptors locations and deployment plans



Information

Vendor neutral deployment descriptors (a.k.a deployment descriptors)

The deployment descriptors are required and their location differs for each module type, but the overall construction is similar.

J2EE module file type Standard deployment descriptors in the J2EE specification
Enterprise Application Archive (EAR) META-INF/application.xml
Web Application Archive (WAR) WEB-INF/web.xml
Jar containing Enterprise Java Beans (JAR) META-INF/ejb-jar.xml
J2EE Connector Resources Adapter Archive (RAR) META-INF/ra.xml
Enterprise Application Client Archive (JAR) META-INF/application-client.xml


An enterprise application archive (EAR) can consist of several modules:
  • Web application modules (WAR)
    Is a collection of servlets, JavaServer Pages (JSP) files, JSP tag libraries, utility classes, static pages, client-side applets, beans, bean classes, and other resources.

  • EJB modules (JAR)
    Contains the bean classes (home, remote, local, and implementation) and all of the utility classes.

  • Resource Adapter modules (RAR)
    Defines J2EE CA connections to external databases. The data source can then be reused by all applications and services via the internal JNDI.

  • Application client modules (JAR)
    An application client is an Enterprise Server specific type of Java EE client. An application client supports the standard Java EE Application Client specifications, and in addition, supports direct access to the Enterprise Server.
A user can either deploy these modules individually or bundle them into a single EAR file and deploy that file.

Vendor specific deployment descriptors (a.k.a deployment plans)

The deployment plans are optional and their location differs for each module type and server.
Their overall construction and filename are also different for each server.

Depending on the server, the deployment plan can be packaged in different ways, for example:
  • In the same location as the standard deployment descriptors.
  • Separated from the archive file (EAR, WAR, RAR or JAR).
Here below the deployment plan filenames for several application servers.

Apache Geronimo (v1.0 - 2.2) / WebSphere Application Server Community Edition (v1.0 - 2.1)

J2EE module file type Geronimo deployment plan
Enterprise Application Archive (EAR) geronimo-application.xml
Web Application Archive (WAR) geronimo-web.xml
Jar containing Enterprise Java Beans (JAR) openejb-jar.xml
J2EE Connector Resources Adapter Archive (RAR) geronimo-ra.xml
Enterprise Application Client Archive (JAR) geronimo-application-client.xml


GlassFish Enterprise Server (v2.1)

J2EE module file type GlassFish deployment plan
Enterprise Application Archive (EAR) sun-application.xml
Web Application Archive (WAR) sun-web.xml
Jar containing Enterprise Java Beans (JAR) sun-ejb-jar.xml

If the EJB component is a version 2.1 or earlier entity bean with container managed persistence, a .dbschema file and a CMP mapping descriptor, sun-cmp-mapping.xml, can be included as well.
J2EE Connector Resources Adapater Archive (RAR) sun-ra.xml

The Enterprise Server does not need to use sun-ra.xml, which previous Enterprise Server versions used to store server-specific deployment information. However, the sun-ra.xml file is still supported for backward compatibility. Instead, the information is stored in the server configuration.
Enterprise Application Client Archive (JAR) sun-application-client.xml


JBoss Enterprise Application Platform (v4.3.0)

J2EE module file type JBoss deployment plan
Enterprise Application Archive (EAR) jboss-app.xml
Web Application Archive (WAR) jboss-web.xml
Jar containing Enterprise Java Beans (JAR) jboss.xml
J2EE Connector Resources Adapater Archive (RAR) -
Enterprise Application Client Archive (JAR) jboss-client.xml


WebSphere Application Server (v7)

J2EE module file type JBoss deployment plan
Enterprise Application Archive (EAR) ibm-application-bnd.xmi
ibm-application-ext.xmi
Web Application Archive (WAR) ibm-web-bnd.xmi
ibm-web-ext.xmi
Jar containing Enterprise Java Beans (JAR) ibm-ejb-jar-bnd.xmi
ibm-ejb-jar-ext.xmi
J2EE Connector Resources Adapater Archive (RAR) -
Enterprise Application Client Archive (JAR) ibm-application-client-bnd.xmi
ibm-application-client-ext.xmi


BEA WebLogic server (v10.0)

J2EE module file type JBoss deployment plan
Enterprise Application Archive (EAR) weblogic-application.xml
Web Application Archive (WAR) weblogic.xml
Jar containing Enterprise Java Beans (JAR) weblogic-ejb-jar.xml
J2EE Connector Resources Adapater Archive (RAR) weblogic-ra.xml
Enterprise Application Client Archive (JAR) weblogic-appclient.xml


JRun (v4)

J2EE module file type JBoss deployment plan
Enterprise Application Archive (EAR) -
Web Application Archive (WAR) jrun-web.xml
Jar containing Enterprise Java Beans (JAR) jrun-ejb-jar.xml
J2EE Connector Resources Adapater Archive (RAR) jrun-ra.xml
Enterprise Application Client Archive (JAR) jrun-application-client.xml