Hitachi

Hitachi Application Server V10 Command Reference Guide (For UNIX® Systems)


2.8.3 deploy

Deploys the specified component.

Synopsis

asadmin [asadmin-options] deploy [--help]
    [--force={false|true}]
    [--virtualservers virtual_servers]
    [--contextroot context_root]
    [--precompilejsp={false|true}]
    [--name component_name]
    [--upload={true|false}]
    [--retrieve local_dirpath]
    [--deploymentplan deployment_plan]
    [--altdd alternate_deploymentdescriptor]
    [--runtimealtdd runtime_alternate_deploymentdescriptor]
    [--deploymentorder deployment_order]
    [--enabled={true|false}]
    [--generatermistubs={false|true}]
    [--availabilityenabled={false|true}]
    [--libraries jar_file[,jar_file]...]
    [--target target]
    [--type pkg-type]
    [--properties name=value[:name=value]...]
    file_archive|filepath

Storage location

Application Server installation directory/javaee/glassfish/bin

Function

The deploy subcommand deploys applications to the server. Applications can be enterprise applications, web applications, Enterprise JavaBeans (EJB) modules, connector modules, and application client modules. If the component is already deployed or already exists, it is forcibly redeployed if the --force option is set to true (the default value is false).

If OutOfMemoryError occurs in the Domain Administration Server (DAS) during application deployment, the error may be caused by insufficient Java heap of the DAS. When specifying the size of Java heap for the DAS, consider the size of the application archive to be deployed.

This subcommand is supported in remote mode only.

Precondition

Domain Administration Server (DAS) is running.

Files

Arguments

--help | -?

Displays the help text for the subcommand.

--force={false|true}

Specifies whether to redeploy the component even if the specified component has already been deployed or already exists.

Type: Boolean

The following values can be specified:

  • true

  • false

Default value: false

--virtualservers virtual_servers

Specifies one or more virtual server IDs.

Type: String

The following values can be specified:

  • One or more virtual server IDs

Default value: N/A

--contextroot context_root

Set the context root of the specified application. Valid only if the archive is a web module.

Type: String

The following values can be specified:

  • Name of the context root for the web module

Default value: File name without extension having archive as web module.

--precompilejsp={false|true}

Specifies whether to allow the JSP to be precompiled during deployment.

When there is a compilation error, the file name of the cause may not be displayed depending on the contents of the error. In this case, compile the .jsp file individually using the jspc command, to identify the file where the error occurred.

Type: Boolean

The following values can be specified:

  • true

  • false

Default value: false

--name component_name

Specifies the name of the deployable component.

The name can include an optional version identifier, which follows the name and is separated from the name by a colon (:). The version identifier must begin with a letter or number. It can contain alphanumeric characters, underscore (_), hyphen (-), and period (.).

Type: String

The following values can be specified:

  • Name of the deployable component

Default value: N/A

--upload={true|false}

Specifies whether the subcommand uploads the file to the DAS.

Type: Boolean

The following values can be specified:

If a directory filepath is specified, this option is ignored.

  • false

    The subcommand does not upload the file and attempts to access the file through the specified file name. If the DAS cannot access the file, then the subcommand fails. For example, the DAS might be running as a different user than the administration user and does not have read access to the file. In this situation, the subcommand fails if the --upload option is set to false.

  • true

    The subcommand uploads the file to the DAS over the network connection.

Default value:

  • If the DAS is on the host where the subcommand is run, the default is false.

  • If the DAS is on a remote host, the default is true.

--retrieve local_dirpath

Retrieves the client stub JAR file from the server machine to the local directory.

Type: String

The following values can be specified:

  • File path where client JAR file are stored

Default value: N/A

--deploymentplan deployment_plan

Deploys the deployment plan, which is a JAR file that contains Java EE RI DD.

Type: String

The following values can be specified:

  • Name of the JAR file

Default value: N/A

--altdd alternate_deploymentdescriptor

Deploys the application using a Java EE standard DD that resides outside of the application archive.

The alternate DD overrides the top-level DD packaged in the archive. For example, for an EAR, the --altdd option overrides the application.xml file. For a standalone module, the --altdd option overrides the top-level module descriptor such as web.xml.

Type: String

The following values can be specified:

  • Path to the DD file

Default value: N/A

--runtimealtdd runtime_alternate_deploymentdescriptor

Deploys the application using Java EE RI DD that reside outside the application archive.

The alternate DD overrides the top-level DD packaged in the archive. For a standalone module, the --runtimealtdd option overrides the top-level module descriptor such as glassfish-web.xml. This applies to Java EE Server DD only (glassfish-*.xml); the name of the alternate DD file must begin with glassfish-. This does not apply to sun-*.xml DD, which are deprecated.

Type: String

The following values can be specified:

  • Specify an absolute path or a relative path to the alternate DD file.

Default value: N/A

--deploymentorder deployment_order

Specifies the deployment order of the application.

Applications with lower numbers are loaded before applications with higher numbers. If two applications have the same deployment order, the first application to be deployed is the first application to be loaded at server startup.

Type: Integer

The following values can be specified:

  • 1 to 2147483647

Default value: 100

--enabled={true|false}

Allows users to access the application.

Type: Boolean

The following values can be specified:

  • true

  • false

Default value: true

--generatermistubs={true|false}

Specifies whether to generate the stubs.

Type: Boolean

The following values can be specified:

  • true

  • false

Default value: false

--availabilityenabled={true|false}

Specifies whether high-availability is enabled for web sessions and for stateful session bean (SFSB) checkpointing and potentially passivation.

Type: Boolean

The following values can be specified:

  • true

  • false

Default value: false

--libraries jar_file

Specifies a comma-separated list of library JAR files. Specify relative paths relative to domain-dir/lib/applibs.

Type: String

The following values can be specified:

  • A comma-separated list of library JAR files

Default value: N/A

--target target

Specifies the target to which you are deploying.

Type: String

The following values can be specified:

  • server

    Deploys the component to the default server instance "server" and is the default value.

  • domain

    Deploys the component to the domain. If domain is the target for an initial deployment, the application is deployed to the domain, but no server instances or clusters reference the application. If domain is the target for a redeployment (the --force option is set to true), and dynamic reconfiguration is enabled for the clusters or server instances that reference the application, the referencing clusters or server instances automatically get the new version of the application. If redeploying, and dynamic configuration is disabled, the referencing clusters or server instances do not get the new version of the application until the clustered or standalone server instances are restarted.

  • cluster_name

    Deploys the component to every server instance in the cluster.

  • instance_name

    Deploys the component to a particular stand-alone sever instance.

Default value: server

--type pkg-type

Specifies the packaging archive type of the component that is being deployed.

Type: String

The following values can be specified:

  • car

    The component is packaged as a CAR file.

  • ear

    The component is packaged as an EAR file.

  • ejb

    The component is an EJB packaged as a JAR file.

  • rar

    The component is packaged as a RAR file.

  • war

    The component is packaged as a WAR file.

Default value: N/A

--properties name=value | --property name=value

Optional keyword-value pairs that specify additional properties for the deployment.

Type: String

The following values can be specified:

  • keepSessions={false|true}

    If the --force option is set to true, this property can be used to specify whether active sessions of the application that is being redeployed are preserved and then restored when the redeployment is complete. Applies to HTTP sessions in a web container. Default is false.

    Type: Boolean

    Default value: false

    Range Value:

    false

    Active sessions of the application are not preserved and restored (default).

    true

    Active sessions of the application are preserved and restored.

    If any active session of the application fails to be preserved or restored, none of the sessions will be available when the redeployment is complete. However, the redeployment continues and a warning is logged. To preserve active sessions, Java EE Server serializes the sessions and saves them in memory. To restore the sessions, the class loader of the newly redeployed application deserializes any sessions that were previously saved.

  • preserveAppScopedResources={false|true}

    If set to true, preserves any application-scoped resources and restores them during redeployment. Default is false.

    Type: Boolean

    Default value: false

    Range Value:

    true

    false

    Other available properties are determined by the implementation of the component that is being redeployed.

Default value: N/A

file_archive|filepath

Specifies the path to the archive that contains the application that is being deployed.

Type: String

The following values can be specified:

  • The path to the archive that contains the application

Default value: N/A

Examples

The following example deploys the enterprise application packaged in the Cart.ear file to the server instance instance1. You can use the --target option to deploy to a different server instance or to a cluster.

asadmin deploy --target instance1 Cart.ear

Exit Status

Exit Status

Explanation

0

command executed successfully.

1

error in executing the command.