2.8.15 redeploy
Redeploys the specified component.
Synopsis
asadmin [asadmin-options] redeploy [--help] --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}] [--contextroot context_root] [--precompilejsp={true|false}] [--virtualservers virtual_servers] [--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 redeploy subcommand of asadmin redeploys an enterprise application, Web application, module based on the Enterprise JavaBeans (EJB) specification (EJB module), connector module, or application client module that is already deployed or already exists. The redeploy command preserves the settings and other options with which the application was originally deployed. This subcommand is supported in remote mode only.
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.
If OutOfMemoryError occurs on the Domain Administration Server (DAS) during application deployment, the error might be caused by insufficient Java heap of the domain administration server. When specifying the size of Java heap for the DAS, take into account the size of the application archive to be deployed.
Precondition
Domain Administration Server (DAS) is running.
Files
-
file_archive|filepath operand takes an input file which will be deployed by the command.
-
use of --retrieve option generates the client stub JAR files in the file path specifies by --retrieve option.
-
--deploymentplan option takes an input JAR file which contains Java EE RI DD.
-
--altdd option takes an input JAR file which contains Java EE standard DD.
-
--runtimealtdd option takes an input JAR file which contains Java EE RI DD.
-
Use of --generatermistubs option generates static RMI-IIOP stubs and put into the client.jar.
-
--libraries option takes input library JAR files which are made available for the deployed application.
Arguments
- --help | -?
-
Displays the help text for the subcommand.
- --virtualservers virtual_servers
-
Specifies one or more virtual server IDs. Multiple IDs are separated by commas.
Type: String
The following values can be specified:
-
Specify virtual server IDs separated by comma
Default value: N/A
-
- --contextroot context_root
-
Specifies the context root of an application. This is enabled only when 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={true|false}
-
Prevents the JSP to be precompiled during deployment. Instead, JSPs are compiled during runtime. Default is false.
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 (_), dash (-), and period (.) characters.
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.
If a directory filepath is specified, this option is ignored.
Type: Boolean
The following values can be specified:
-
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, 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 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
- --deploymentplan deployment_plan
-
Deploys the deployment plan, which is a JAR file that contains Java EE RI DD.
Specify this option when deploying a pure EAR file. A pure EAR file is an EAR without Java EE Server descriptors.
- --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 resides outside of 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. Applies to Java EE Server DD only (glassfish-*.xml); the name of the alternate DD file must begin with glassfish-. 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. This relative path is Application Server installation directory/javaee/glassfish/bin
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.
If you deploy to the target domain, this option is ignored, since deploying to the domain doesn't deploy to a specific instance or cluster.
Type: Boolean
The following values can be specified:
-
true
-
false
Default value: true
-
- --generatermistubs={false|true}
-
Generates static RMI-IIOP stubs (if set to true) and adds them to the client.jar. If set to false, the stubs are not generated. Default is false.
Type: Boolean
The following values can be specified:
-
true
-
false
Default value: false
-
- --libraries jar_file[,jar_file]...
-
Specifies a comma-separated list of library JAR files.
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.
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 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.
The following values are valid:
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 redeployment, 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 server 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 | --property} name=value[:name=value]...
-
Specifies the optional keyword-value pairs that specify additional properties for deployment.
The available properties are determined by the implementation of the component that is being deployed or redeployed. The --properties option and the --property option are equivalent. You can use either of these options regardless of the number of properties that you specify.
Type: String
The following values can be specified:
-
keepSessions=value
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.
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.
Type: Boolean
Default value: false
Range Value: true/false
-
preserveAppScopedResources=value
If set to true, preserves any application-scoped resources and restores them during redeployment. Default is false.
Other available properties are determined by the implementation of the component that is being redeployed.
Type: Boolean
Default value: false
Range Value: true/false
Default value: N/A
-
- file_archive|filepath
-
Specifies the path to the archive that contains the application that is being redeployed. This path can be a relative path or an absolute path. This relative path is Application Server installation directory/javaee/glassfish/bin.
The operand can specify a directory or an archive file.
Type: String
The following values can be specified:
-
Path to the archive
Default value: N/A
-
Examples
The following example redeploys the Web application hellodir. The application was originally deployed from a directory on the server instance instance1.
asadmin redeploy --target instance1 --name hellodir
Exit Status
Exit Status |
Explanation |
---|---|
0 |
subcommand executed successfully. |
1 |
error in executing the subcommand. |