Sun GlassFish Enterprise Server v3 Application Deployment Guide

ProcedureTo Deploy an Application or Module

Use the deploy subcommand in remote mode to deploy an assembled application or module to Enterprise Server. If an error occurs during deployment, the application or module is not deployed. These failures prevent a partial deployment that could leave the server in an inconsistent state.

If the component is already deployed or already exists, you can forcefully redeploy if you set the --force option of the deploy subcommand to true. See Example 2–9. The redeploy subcommand also accomplishes this. You can see the status of a component by using the show-component-status(1) subcommand.

The Java EE 6 specification defines the portable application-name, which allows you to specify an application name in the application.xml file. For example:


This name is used before the archive name to derive the default application registration name. The application will be deployed under xyz if the application.xml file defines application-name as xyz. The user-specified name has the highest precedence. If no application-name is specified in the application.xml file, the application is deployed using the archive name (minus suffix) as the application registration name.

  1. Ensure that the server is running.

    Remote commands require a running server.

  2. (Optional) List deployed components by using the list-components(1) subcommand.

  3. Deploy the application or module by using the deploy(1) subcommand.

    Information about the options and properties of the subcommand is included in this help page.

  4. (Optional) If needed, fix issues and rerun the deploy subcommand.

Example 2–1 Deploying an Enterprise Application

This example deploys newApp.ear to the default server, server.

asadmin> asadmin> deploy Cart.ear
Application deployed successfully with name Cart.
Command deploy executed successfully

Example 2–2 Deploying a Connector Module

This example deploys a connector modules that is packaged in an RAR file.

asadmin> deploy jdbcra.rar
Application deployed successfully with name jdbcra.
Command deploy executed successfully

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help deploy at the command line.