Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{scrollbar}

When you develop a Java EE asset, you must include Java EE deployment descriptors as required by the Java EE specification. Although necessary, Java EE deployment descriptors are not sufficient to deploy your asset in a server. They do not include information unique to the application server or a given server's configuration.

Your server uses deployment plans to provide the missing details. Each deployment plan is an XML document where the document schema depends on the Java EE module that you wish to deploy.

The following sections will help you choose the correct deployment plan schema and the correct deployment options.

Deploying without a deployment plan

If you want to deploy a Java EE asset without a deployment plan, the server will perform the operation with default values.

  • If your asset is very simple, for example, just servlets and JSPs that require no security and do not access any external resources, you can deploy without a deployment plan.
  • If the asset developers have carefully crafted their asset so that the required resource names precisely match the names configured in your server, you can deploy without a deployment plan.

This option might be convenient if you are deploying samples, migrating simple assets intended for other application servers, or working with assets under development, but it is typically worthwhile to take a broader view. Successful assets do not always stay simple and you need to provide a deployment plan when your asset

  • Needs to be served from an explicit context
  • Depends on external Java libraries not included in the default classpath
  • Uses security roles or a security realm other than the system default realm
  • References a resource (a data source, a message queue, a connector) that must be matched to the server's configuration
  • Uses an external EJB
  • Implements a connector that requires configuration.

Even if you believe that a deployment plan might not be necessary for a particular Java EE asset, consider providing a deployment plan so that your plans and procedures include it. This will simplify your effort when the asset is enhanced to the point where a deployment plan is required.

Choosing a deployment plan packaging option

Deployment plans can be packaged as a file within your Java EE asset's archive or as a separate file. To choose between these options consider the following trade-offs.

  • If you place the plan within the archive, you simplify the effort required to distribute and deploy the asset. Users have only one file to manage and one file name to enter during a deploy operation. On the other hand, if the users need to modify the plan, they must extract the archive, make their changes, and rebuild the archive before they can deploy the asset.
  • If you package the deployment plan as a separate file, you simplify the effort to modify the plan to match the users' particular server configuration. On the other hand, the users must manage two files, the archive and the deployment plan, and specify both when they deploy the asset.

If you are distributing the asset to a collection of users where the server configurations are identical and well known, packaging the deployment plan in the archive is preferred. If you are distributing the asset to a collection of users where server configurations are varied and unknown, the plan will need to be modified and an external plan is preferred.

If you choose to package your deployment plan within the archive, you must give the file a required name and place it in a required location. See the next section for details.

Choosing the correct XML document element

When you develop a deployment plan, the XML document element you use will depend on the Java EE module type that you intend to deploy. In addition, the format of the document must comply with the XML schema found in your server. Schemas can be found in <WASCE_HOME>/schema where <WASCE_HOME> is the server's installation directory.

Java EE module type

Document element

XML schema filename

Web Application (WAR)

web-app

geronimo-web-2.0.1.xsd

Enterprise Application (EAR)

application

geronimo-application-2.0.xsd

Enterprise Java Beans (JAR)

openejb-jar

openejb-jar-2.1.xsd

J2EE Connectors (RA)

connector

geronimo-connector-1.2.xsd

Client Application

application-client

geronimo-application-client-2.0.xsd

Furthermore, if you intend to package your deployment plan within the module you wish to deploy, you must give the file a required name and place it in a required location.

Java EE Module Type

Deployment plan filename and location when included in module

Web Application (WAR)

WEB-INF/geronimo-web.xml

Enterprise Application (EAR)

META-INF/geronimo-application.xml

Enterprise Java Beans (JAR)

META-INF/openejb-jar.xml

J2EE Connectors (RA)

META-INF/geronimo-ra.xml

Client Application

META-INF/geronimo-application-client.xml

Excerpt

There are several alternatives available for Deploying and undeploying applications

:

...