Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Application Server Enterprise Edition 8 2004Q4 Beta Administration Guide 

Chapter 5
Deploying Applications

This chapter explains how to deploy (install) J2EE applications on the Application Server. This chapter contains following sections:


About Deployment

The Deployment Life Cycle

After installing the Application Server and started a domain, you can deploy (install) J2EE applications and modules. During deployment, an application or module can go through the following stages:

  1. Initial Deployment
  2. Deploy (install) an application or module into a specific domain, standalone server instance, or cluster. If you deploy the application only to the domain, it exists in the domain's central repository, but no server instances or clusters reference it. Before deploying an application or module, start the domain. Because applications and modules are packaged in archive files, specify the archive file name during deployment.

    If you deploy using the asadmin tool, the default is to deploy to the default server instance. If you deploy using the Admin Console, the default is to deploy to the domain.

    Deployment is dynamic: you don't need to restart the server instance after you deploy an application. If you do restart, all deployed applications and modules are still deployed.

  3. Enabling or Disabling
  4. By default, a deployed application or module is enabled, which means that it is runnable and can be accessed by clients if it has been deployed to an accessible server instance or cluster. To prevent access, disable the application or module. A disabled application or module is not uninstalled from the domain and can be easily enabled.

  5. Adding or Deleting Targets for a Deployed Application
  6. Once deployed, the application or module exists in the central repository and can be referenced by a number of server instances and/or clusters. To change which server instances and clusters reference an application after the application is deployed, change an applications's targets. Because the application itself is stored in the central repository, the same version of the application is deployed to different server instances or clusters. However, an application deployed to more than one target can be enabled on one and disabled on another.

  7. Redeployment
  8. To replace a deployed application or module, redeploy it. You don't have to undeploy and then deploy it again.

    You can add additional target server instances or clusters when you redeploy.

    For more information about redeploying applications to multiple targets, see "Redeploying to Multiple Targets".

  9. Undeployment
  10. To uninstall an application or module, undeploy it.

Types of J2EE Archive Files

A software provider packages an application or module into a archive file. To deploy the application or module, specify the archive file name. The content and structure of the archive file is defined by the specifications of the J2EE platform. Types of J2EE archive files are as follows:

The software provider might assemble an application into a single EAR file or into separate WAR, EJB JAR, and application client JAR files. In the administration tools, the deployment pages and commands are similar for all types of files.

Naming Conventions

In a given domain, the names of deployed applications and modules must be unique.

Modules of different types can have the same name within an application. When the application is deployed, the directories holding the individual modules are named with _jar, _war and _rar suffixes. Modules of the same type within an application must have unique names. In addition, database schema file names must be unique within an application.

Using a Java package-like naming scheme is recommended for module filenames, EAR filenames, module names as found in the <module-name> portion of the ejb-jar.xml files, and EJB names as found in the <ejb-name> portion of the ejb-jar.xml files. The use of this package-like naming scheme ensures that name collisions do not occur. The benefits of this naming practice apply not only to the Sun Java System Application Server, but to other J2EE application servers as well.

JNDI lookup names for EJBs must also be unique. Establishing a consistent naming convention might help. For example, appending the application name and the module name to the EJB name is one way to guarantee unique names. In this case, mycompany.pkging.pkgingEJB.MyEJB would be the JNDI name for an EJB in the module pkgingEJB.jar, which is packaged in the application pkging.ear.

Make sure package and file names do not contain spaces or characters that are illegal for the operating system.


Admin Console Tasks for Deploying Applications

Deploying an Enterprise Application

An enterprise application is packaged in an EAR file, a type of archive file that contains any type of J2EE standalone modules, such as WAR and EJB JAR files.

To deploy (install) an enterprise application:

  1. In the tree component, expand the Applications node.
  2. Select the Enterprise Applications node.
  3. On the Enterprise Applications page, click Deploy.
  4. On the Deployment page, specify the EAR file to deploy.
  5. The server machine is the host that is running the application server domain administration server. The client machine is the host on which you are viewing the Admin Console through a browser. If a file or directory is said to reside on a server or client machine, it might really live on another host, but the file or directory must be accessible from the file system of the server or client machine.

    1. For the Upload File button, if the file resides on the client machine, select Yes. If the file resides on the server machine, then select No.
    2. To deploy an unpackaged application from an exploded directory, select No. The exploded directory must reside on the server machine. Deploying from an exploded directory is for advanced developers and is not recommended for production environments.

    3. In the File Or Directory field, to deploy a file click Browse and locate the file (or type the full path name of the file). To deploy from an exploded directory, type the full path name of the directory.
  6. Click Next to display the Deploy Enterprise Application page.
  7. On the Deploy Enterprise Application page, specify the settings for the application.
    1. In the Application Name field, either retain the default name, which is the prefix of the file name, or type another name. The application name must be unique.
    2. By default, an application is available as soon as it is deployed. To disable the application so that is unavailable after deployment, deselect the Enabled checkbox.
    3. If the application has already been deployed, it is replaced with the new application unless you deselect the Redeploy checkbox.
    4. If you deployed an application or module to multiple clusters or server instances, you must redeploy it to all clusters or instances that share it. Otherwise, you see an error.

    5. To verify the structure and contents of the file before deployment, select the Verifier checkbox. Verification of large applications can be time-consuming. Verify the file if you suspect it is corrupt or non-portable.
    6. To precompile JSP pages, select the JSPs checkbox. If you do not select this checkbox, the JSP pages are compiled at runtime when they are first accessed. Because compilation is often time-consuming, in a production environment select this checkbox.
    7. Choose a high availability setting.
    8. To enable high availability for the application, select the Availability checkbox. If availability is enabled for an application, it must also be enabled at all higher levels (named configuration and web container or EJB container) as well.

    9. Choose the targets to which to deploy the application.
    10. From the list of available targets, choose the target or targets and click Add. Targets can be clusters or standalone server instances. If you do not select an item from the drop-down list, the application is deployed to the domain, and is not associated with any target instance or cluster.

      Note that this behavior is different than the behavior when you use the asadmin tool. In that case, an unspecified target deploys the application to the default server instance server.

    11. Choose whether to generate RMI stubs.
    12. If you choose to generate RMI stubs, static RMI-IIOP stubs are generated and put into the client.jar.

  8. Click OK to deploy the application.

Equivalent asadmin command: deploy

Deploying a Web Application

A Web application is packaged in a WAR file, a type of archive file that contains components such as servlets and JSP pages.

To deploy (install) a Web application:

  1. In the tree component, expand the Applications node.
  2. Select the Web Applications node.
  3. On the Web Applications page, click Deploy.
  4. On the Deployment page, specify the WAR file to deploy.
  5. The server machine is the host that is running the application server domain administration server. The client machine is the host on which you are viewing the Admin Console through a browser. If a file or directory is said to reside on a server or client machine, it might really live on another host, but the file or directory must be accessible from the file system of the server or client machine.

    1. For the Upload File button, if the file resides on the client machine, select Yes. If the file resides on the server machine, select No.
    2. To deploy an unpackaged application from an exploded directory, select No. The exploded directory must reside on the server machine. Deploying from an exploded directory is for advanced developers and is not recommended for production environments.

    3. In the File Or Directory field, to deploy a file click Browse and locate the file (or type the full path name of the file). To deploy from an exploded directory, type the full path name of the directory.
  6. Click Next to display the Deploy Web Application page.
  7. On the Deploy Web Application page, specify the settings for the application.
    1. In the Application Name field, either retain the default name, which is the prefix of the file name, or type another name. (The default name appears if you select Yes for the Upload File button.) The application name must be unique.
    2. In the Context Root field, enter a string that identifies the Web application. In the URL of the Web application, the context root immediately follows the port number (http://host:port/context-root/...). Make sure that the context root starts with a forward slash, for example: /hello
    3. By default, an application is available as soon as it is deployed. To disable the application so that is unavailable after deployment, deselect the Enabled checkbox.
    4. If the application has already been deployed, it will be replaced with the new application unless you deselect the Redeploy checkbox.
    5. If you deployed an application or module to multiple clusters or server instances, you must redeploy it to all clusters or instances that share it. Otherwise, you see an error.

    6. To verify the structure and contents of the file before deployment, select the Verifier checkbox. Verification of large applications is often time-consuming. Verify the file if you suspect it is corrupt or non-portable.
    7. To precompile JSP pages, select the JSPs checkbox. If you do not select this checkbox, the JSP pages are compiled at runtime when they are first accessed. Because compilation is often time-consuming, in a production environment select this checkbox.
    8. Choose a high availability setting.
    9. To enable high availability for the application, select the Availability checkbox. If availability is enabled for an application, it must also be enabled at all higher levels (named configuration and web container or EJB container) as well.

    10. Choose the targets to which to deploy the application.
    11. From the list of available targets, choose the target or targets and click Add. Targets can be clusters or standalone server instances. If you do not select an item from the drop-down list, the application is deployed to the domain, and is not associated with any target instance or cluster.

      Note that this behavior is different than the behavior when you use the asadmin tool. In that case, an unspecified target deploys the application to the default server instance server.

    12. Choose whether to generate RMI stubs.
    13. If you choose to generate RMI stubs, static RMI-IIOP stubs are generated and put into the client.jar.

  8. Click OK to deploy the application.

Equivalent asadmin command: deploy

Deploying an EJB Module

An EJB Module, also called an EJB JAR file, contains enterprise beans.

To deploy (install) an EJB module:

  1. In the tree component, expand the Applications node.
  2. Select the EJB Modules node.
  3. On the EJB Module page, click Deploy.
  4. On the Deployment page, specify the JAR file to deploy.
  5. The server machine is the host that is running the application server domain administration server. The client machine is the host on which you are viewing the Admin Console through a browser. If a file or directory is said to reside on a server or client machine, it might really live on another host, but the file or directory must be accessible from the file system of the server or client machine.

    1. For the Upload File button, if the file resides on the client machine, select Yes. If the file resides on the server machine, select No.
    2. To deploy an unpackaged application from an exploded directory, select No. The exploded directory must reside on the server machine. Deploying from an exploded directory is for advanced developers and is not recommended for production environments.

    3. In the File Or Directory field, to deploy a file click Browse and locate the file (or type the full path name of the file). To deploy from an exploded directory, type the full path name of the directory.
  6. Click Next to display the Deploy EJB Module page.
  7. On the Deploy EJB Module page, specify the settings for the application.
    1. In the Application Name field, either retain the default name, which is the prefix of the file name, or type another name. The application name must be unique.
    2. By default, an application is available as soon as it is deployed. To disable the application so that is unavailable after deployment, deselect the Enabled checkbox.
    3. If the application has already been deployed, it will be replaced with the new application unless you deselect the Redeploy checkbox.
    4. If you deployed an application or module to multiple clusters or server instances, you must redeploy it to all clusters or instances that share it. Otherwise, you see an error.

    5. To verify the structure and contents of the file before deployment, select the Verifier checkbox. Verification of large applications can be time-consuming. Verify the file if you suspect it is corrupt or non-portable.
    6. Choose a high availability setting.
    7. To enable high availability for the application, select the Availability checkbox. If availability is enabled for an application, it must also be enabled at all higher levels (named configuration and web container or EJB container) as well.

    8. Choose the targets to which to deploy the application.
    9. From the list of available targets, choose the target or targets and click Add. Targets can be clusters or standalone server instances. If you do not select an item from the drop-down list, the application is deployed to the domain, and is not associated with any target instance or cluster.

      Note that this behavior is different than the behavior when you use the asadmin tool. In that case, an unspecified target deploys the application to the default server instance server.

    10. Choose whether to generate RMI stubs.
    11. If you choose to generate RMI stubs, static RMI-IIOP stubs are generated and put into the client.jar.

  8. Click OK to deploy the module.

Equivalent asadmin command: deploy

Deploying a Connector Module

A connector, also known as a resource adapter, is packaged in a type of archive file called a RAR file.

To deploy (install) a connector module:

  1. In the tree component, expand the Applications node.
  2. Select the Connector Modules node.
  3. On the Connector Modules page, click Deploy.
  4. On the Deployment page, specify the RAR file to deploy.
  5. The server machine is the host that is running the application server domain administration server. The client machine is the host on which you are viewing the Admin Console through a browser. If a file or directory is said to reside on a server or client machine, it might really live on another host, but the file or directory must be accessible from the file system of the server or client machine.

    1. For the Upload File button, if the file resides on the client machine, then select Yes. If the file resides on the server machine, then select No.
    2. To deploy an unpackaged application from an exploded directory, select No. The exploded directory must reside on the server machine. Deploying from an exploded directory is for advanced developers and is not recommended for production environments.

    3. In the File Or Directory field, to deploy a file click Browse and locate the file (or type the full path name of the file). To deploy from an exploded directory, type the full path name of the directory.
  6. Click Next to display the Deploy Connector Module page.
  7. On the Deploy Connector Module page, specify the settings for the application.
    1. In the Application Name field, either retain the default name, which is the prefix of the file name, or type another name. The application name must be unique.
    2. By default, an application is available as soon as it is deployed. If you want to disable the application so that it is unavailable after deployment, deselect the Enabled checkbox.
    3. When you enable or disable a connector module, you also enable or disable the connector resources and connection pools that point to the module.

    4. If the application has already been deployed, it will be replaced with the new application unless you deselect the Redeploy checkbox.
    5. If you deployed an application or module to multiple clusters or server instances, you must redeploy it to all clusters or instances that share it. Otherwise, you see an error.

    6. To verify the structure and contents of the file before deployment, select the Verifier checkbox. Verification of large applications is often time-consuming. Verify the file if you suspect it is corrupt or non-portable.
    7. If the resource adapter has additional properties specified, they are displayed.
    8. Use the table to modify the default values of these properties.

    9. Choose the targets to which to deploy the module.
    10. From the list of available targets, choose a target or targets and click Add. Targets can be clusters or standalone server instances. If you do not select an item from the drop-down list, the application is deployed to the domain, and is not associated with any target instance or cluster.

      Note that this behavior is different than the behavior when you use the asadmin tool. In that case, an unspecified target deploys the application to the default server instance server.

  8. Click OK to deploy the module.

Equivalent asadmin command: deploy

Creating a Lifecycle Module

A lifecycle module performs tasks when it is triggered by one or more events in the server lifecycle. These server events are:

Lifecycle modules are not part of the J2EE specification, but are an enhancement to the Sun Java System Application Server.

To create a lifecycle module:

  1. In the tree component, expand the Applications node.
  2. Select the Lifecycle Modules node.
  3. On the Lifecycle Modules page, click New.
  4. On the Create Lifecycle Module page, specify the settings:
    1. In the Name field, type a name that denotes the function of the module.
    2. In the Class Name field, type the fully qualified name of the lifecycle module's class file.
    3. If the JAR file containing the lifecycle is in the server's classpath, then leave the Classpath field blank. Otherwise, type the fully qualified path.
    4. If you don't specify the classpath, you must unpack the classes in application_server_home/domains/domain/applications/lifecycle-module/module_name. If you specify a classpath, nothing else is required.

    5. In the Load Order field, type an integer greater than 100 and less than the operating system's MAXINT value.
    6. The integer determines the order in which lifecycle modules are loaded when the server starts up. Modules with smaller integers are loaded sooner.

    7. When you start the server, it loads lifecycle modules that are already deployed. By default, if a load fails, the server continues the start-up operation. To prevent the server from starting up when a load fails, select the On Load Failure checkbox.
    8. By default, a module is available as soon as it is deployed. To disable the module so that is unavailable after deployment, deselect the Enabled checkbox.
  5. Click OK.

Equivalent asadmin command: create-lifecycle-module

Deploying an Application Client Module

An application client module, also called a J2EE application client JAR file, contains the server-side routines for the client.

To deploy (install) an application client module:

  1. In the tree component, expand the Applications node.
  2. Select the App Client Modules node.
  3. On the Application Client Modules page, click Deploy.
  4. On the Deployment page, specify the JAR file to deploy.
  5. The server machine is the host that is running the application server domain administration server. The client machine is the host on which you are viewing the Admin Console through a browser. If a file or directory is said to reside on a server or client machine, it might really live on another host, but the file or directory must be accessible from the file system of the server or client machine.

    1. For the Upload File button, if the file resides on the client machine, select Yes. If the file resides on the server machine, select No.
    2. To deploy an unpackaged application from an exploded directory, select No. The exploded directory must reside on the server machine. Deploying from an exploded directory is for advanced developers and is not recommended for production environments.

    3. In the File Or Directory field, to deploy a file click Browse and locate the file (or type the full path name of the file). To deploy from an exploded directory, type the full path name of the directory.
  6. Click Next to display the Deploy Application Client Module page.
  7. On the Deploy Application Client Module page, specify the settings for the application.
    1. In the Application Name field, either retain the default name, which is the prefix of the file name, or type another name. The application name must be unique.
    2. If the application has already been deployed, it will be replaced with the new application unless you deselect the Redeploy checkbox.
    3. If you deployed an application or module to multiple clusters or server instances, you must redeploy it to all clusters or instances that share it. Otherwise, you see an error.

    4. To verify the structure and contents of the file before deployment, select the Verifier checkbox. Verification of large applications can be time-consuming.Verify the file if you suspect it is corrupt or non-portable.
    5. Choose the targets to which to deploy the module.
    6. From the list of available targets, choose a target or targets and click Add. Targets can be clusters or standalone server instances. If you do not select an item from the drop-down list, the application is deployed to the domain, and is not associated with any target instance or cluster.

      Note that this behavior is different than the behavior when you use the asadmin tool. In that case, an unspecified target deploys the application to the default server instance server.

    7. Choose whether to generate RMI stubs.
    8. If you choose to generate RMI stubs, static RMI-IIOP stubs are generated and put into the client.jar.

  8. Click OK to deploy the module.

For the client-side routines:

Equivalent asadmin command: deploy


Admin Console Tasks for Listing, Undeploying, and Enabling Applications

Listing Deployed Applications

To list deployed applications:

  1. In the tree component, expand the Applications node.
  2. Expand the node for the application or module type.

To view the details of a deployed application or module either:

Equivalent asadmin command: list-components

Listing Subcomponents

Enterprise and Web applications and Connector Modules contain subcomponents. For example, a Web application might contain one or more servlets. Use the same method for listing the subcomponents of Enterprise and Web applications and Connector Modules.

To list the subcomponents of a Web application:

  1. In the tree component, expand the Applications node.
  2. Expand the Web Applications node.
  3. Select the node for a particular Web application.
  4. On the Web Application page, note the contents of the Sub Components table.

Equivalent asadmin command: list-sub-components

Viewing Module Descriptors of Deployed Applications or Modules

For Enterprise Applications, Web Applications, EBJ Modules, Connector Modules, and App Client Modules, you can view the module deployment descriptors.

  1. In the tree component, expand the Applications node.
  2. Select the node for the type of application or module for which you want to view descriptors.
  3. Select the node for the deployed application.
  4. Select the Descriptor tab.
  5. To see the text of the descriptor file, click the file name.
  6. The page displays the file contents. This information is read-only.

Undeploying an Application

Undeploying an application or module uninstalls it from the domain.

To undeploy an application or module:

  1. In the tree component, expand the Applications node.
  2. Select the node for the type of application or module want to undeploy.
  3. In the table listing the deployed applications, select the checkbox for the application you want to undeploy.
  4. Click Undeploy.

Equivalent asadmin command: undeploy

Enabling and Disabling an Application

If a deployed application or module is enabled, it is accessible by clients. If it is disabled, it is still deployed but is not accessible by clients. By default, when you deploy an application or module, it is enabled because the Status checkbox on the Deploy page is selected.

To enable a deployed application or module:

  1. In the tree component, expand the Applications node.
  2. Expand the node for the application type.
  3. Select the node for the deployed application or module.
  4. Select the Status checkbox.

To disable a deployed application or module, deselect the Status checkbox.

Equivalent asadmin commands: enable and disable

Managing Application Targets

After deploying an application or module, manage the server instances and clusters that reference it by managing targets.

  1. In the tree component, expand the Applications node.
  2. Expand the node for the application type.
  3. Select the node for the deployed application.
  4. Select the Targets tab.
  5. To enable or disable an application on a specific target instance or cluster, click the checkbox next to the target and choose enable or disable from the drop-down menu.
  6. To add or delete targets for the application, chose Manage Targets.
  7. Add or remove targets and click OK.
  8. The application is now available on the revised list of targets.

Equivalent asadmin commands: create-application-ref, delete-application-ref.

Deploying on Additional Virtual Servers

After deploying an application or module to a target server instance or cluster of instances, you can associate it with additional virtual servers.

  1. From the deployed application or module's Target page, click the Manage Virtual Servers link next to the target.
  2. Add or remove virtual server targets from the list of available virtual servers.
  3. Click OK.

Redeploying to Multiple Targets

If an application is deployed to multiple targets (standalone server instances or clusters), you cannot redeploy to multiple targets. Use the following method to make sure all server instances that reference an application receive the most recent version.

  1. Delete the application references for all but one target.
  2. Redeploy the application to the target that still references it.
  3. Create application references for the additional targets until all servers that originally referenced the application do so again.
  4. Users experience no loss of service because the servers are never shut down and restarted.

Enabling and Disabling Dynamic Reloading

If dynamic reloading is enabled, the server periodically checks for changes in the files of the deployed application and automatically reloads the application with the changes. Dynamic reloading is useful in a development environment because it allows code changes to be tested quickly. In a production environment, however, dynamic reloading may degrade performance.

Dynamic reloading is intended for development environments. It is incompatible with session persistence, a production environment feature. Do not enable session persistence if dynamic deployment is enabled.


Note

Dynamic reloading is only available for the default server instance.


To configure dynamic reloading:

  1. In the tree component, expand the relevant configuration node.
  2. Select Deployment Settings.
  3. On the Applications Configuration page, configure the following:
    • Reload: Enable or disable dynamic reloading with the Enabled checkbox.
    • Reload Poll Interval: Specify how often the server checks for changes in the deployed applications.
    • Admin Session Timeout: Specify the amount of time before the Admin Session times out and you have to log in again.
    • XML Validation:
      • full: If XML validation fails, deployment fails.
      • parsing: XML validation errors are reported but deployment occurs.
      • none: No XML validation is performed.


Deployment Methods for Developers

Using Auto Deploy

The auto deploy feature enables you to deploy a pre-packaged application or module by copying it to the install_dir/domains/domain_dir/autodeploy directory.

For example, copy a file named hello.war to the install_dir/domains/domain1/autodeploy directory. To undeploy the application, remove the hello.war file from the autodeploy directory.

The auto deploy feature is intended for development environments. It is incompatible with session persistence, a production environment feature. Do not enable session persistence if dynamic deployment is enabled


Note

Auto deploy is only available for the default server instance.


To configure the auto deploy feature:

  1. In the tree component, expand the configuration node for which to change the auto deploy settings.
  2. Select Deployment Settings.
  3. On the Applications Configuration page, configure the following:
    1. Enable or disable auto deploy by selecting or deselecting the Enabled checkbox.
    2. In the Auto Deploy Poll Interval field, specify how often the server checks the auto deploy directory for application or module files. Changing the poll interval will not affect the amount of time it takes to deploy an application or module.
    3. In the Auto Deploy Directory, if you specify the directory where you build your application, then you won't have to copy the file to the default auto deploy directory.
    4. The default is a directory called autodeploy in the server instance's root directory. By default a variable is used to eliminate the need to manually change the directory for multiple server instances.

    5. To run the verifier before deployment, select the Verifier Enabled checkbox. The verifier examines the structure and content of the file. Verification of large applications is often time-consuming.
    6. To precompile JSP pages, select the JSPs checkbox. If you do not select this checkbox, the JSP pages are compiled at runtime when they are first accessed. Because compilation is often time-consuming, in a production environment select this checkbox.

Deploying an Unpackaged Application From a Directory

This feature is for advanced developers.

Use directory deployment only to deploy to the default server instance (server). You cannot use it to deploy to clusters or standalone server instances.

A directory containing an unpackaged application or module is sometimes called an exploded directory. The contents of the directory must match the contents of a corresponding J2EE archive file. For example, if you deploy a Web application from a directory, the contents of the directory must be the same as a corresponding WAR file. For information about the required directory contents, see the appropriate specifications.

You can change the deployment descriptor files directly in the exploded directory. If dynamic reloading is enabled, the server automatically detects the changes and reloads the application. See "Enabling and Disabling Dynamic Reloading".

To deploy an unpackaged application from a directory:

  1. In the Admin Console, begin the deployment process. See "Deploying a Web Application".
  2. On the Deployment page, specify the following:
    1. Under Upload File, select No.

Equivalent asadmin command: deploydir

Using the deploytool Utility

Designed for software developers, the deploytool utility packages and deploys J2EE applications and modules. For instructions on how to use deploytool, see The J2EE 1.4 Tutorial.

Using a Deployment Plan

This feature is for advanced developers.

A deployment plan is an JAR file that contains only the deployment descriptors that are specific to the Application Server. These deployment descriptors, for example sun-application.xml, are described in the Application Server Developer's Guide. The deployment plan is part of the implementation of JSR 88: J2EE Application Deployment. Use a deployment plan to deploy an application or module that does not contain the deployment descriptors that are specific to the Application Server.

To deploy using a deployment plan, specify the --deploymentplan option of the asadmin deploy command. The following command, for example, deploys the enterprise application in the myrosterapp.ear file according to the plan specified by the mydeployplan.jar file.

$ asadmin deploy --user admin ---deploymentplan mydeployplan.jar myrosterapp.ear

In the deployment plan file for an enterprise application (EAR), the sun-application.xml file is located at the root. The deployment descriptor for each module is stored according to this syntax: module-name.sun-dd-name, where the sun-dd-name depends on the module type. If a module contains a CMP mappings file, the file is named module-name.sun-cmp-mappings.xml. A .dbschema file is stored at the root level with each forward slash character (/) replaced by a pound sign (#). The following listing shows the structure of the deployment plan file for an enterprise application (EAR).

$ jar -tvf mydeployplan.jar
420 Thu Mar 13 15:37:48 PST 2003 sun-application.xml
370 Thu Mar 13 15:37:48 PST 2003 RosterClient.war.sun-web.xml
418 Thu Mar 13 15:37:48 PST 2003 roster-ac.jar.sun-application-client.xml
1281 Thu Mar 13 15:37:48 PST 2003 roster-ejb.jar.sun-ejb-jar.xml
2317 Thu Mar 13 15:37:48 PST 2003 team-ejb.jar.sun-ejb-jar.xml
3432 Thu Mar 13 15:37:48 PST 2003 team-ejb.jar.sun-cmp-mappings.xml
84805 Thu Mar 13 15:37:48 PST 2003 team-ejb.jar.RosterSchema.dbschema

In the deployment plan for a web application or a module file, the deployment descriptor that is specific to the Application Server is at the root level. If a stand-alone EJB module contains a CMP bean, the deployment plan includes the sun-cmp-mappings.xml and .dbschema files at the root level. In the following listing, the deployment plan describes a CMP bean.

$ jar r -tvf myotherplan.jar
3603 Thu Mar 13 15:24:20 PST 2003 sun-ejb-jar.xml
3432 Thu Mar 13 15:24:20 PST 2003 sun-cmp-mappings.xml
84805 Thu Mar 13 15:24:20 PST 2003 RosterSchema.dbschema



Previous      Contents      Index      Next     


Copyright 2004 Sun Microsystems, Inc. All rights reserved.