JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1-3.1.1 Reference Manual
search filter icon
search icon

Document Information

Preface

Oracle GlassFish Server 3.1 Section 1: asadmin Utility Subcommands

add-resources(1)

apply-http-lb-changes(1)

backup-domain(1)

change-admin-password(1)

change-master-broker(1)

change-master-password(1)

collect-log-files(1)

configure-jms-cluster(1)

configure-lb-weight(1)

configure-ldap-for-admin(1)

copy-config(1)

create-admin-object(1)

create-application-ref(1)

create-audit-module(1)

create-auth-realm(1)

create-backup-config(1)

create-cluster(1)

create-connector-connection-pool(1)

create-connector-resource(1)

create-connector-security-map(1)

create-connector-work-security-map(1)

create-custom-resource(1)

create-domain(1)

create-file-user(1)

create-http(1)

create-http-health-checker(1)

create-http-lb(1)

create-http-lb-config(1)

create-http-lb-ref(1)

create-http-listener(1)

create-http-redirect(1)

create-iiop-listener(1)

create-instance(1)

create-jacc-provider(1)

create-javamail-resource(1)

create-jdbc-connection-pool(1)

create-jdbc-resource(1)

create-jmsdest(1)

create-jms-host(1)

create-jms-resource(1)

create-jndi-resource(1)

create-jvm-options(1)

create-lifecycle-module(1)

create-local-instance(1)

create-message-security-provider(1)

create-network-listener(1)

create-node-config(1)

create-node-ssh(1)

create-password-alias(1)

create-profiler(1)

create-protocol(1)

create-protocol-filter(1)

create-protocol-finder(1)

create-resource-adapter-config(1)

create-resource-ref(1)

create-schedule(1)

create-service(1)

create-ssl(1)

create-system-properties(1)

create-threadpool(1)

create-transport(1)

create-virtual-server(1)

delete-admin-object(1)

delete-application-ref(1)

delete-audit-module(1)

delete-auth-realm(1)

delete-backup-config(1)

delete-cluster(1)

delete-config(1)

delete-connector-connection-pool(1)

delete-connector-resource(1)

delete-connector-security-map(1)

delete-connector-work-security-map(1)

delete-custom-resource(1)

delete-domain(1)

delete-file-user(1)

delete-http(1)

delete-http-health-checker(1)

delete-http-lb(1)

delete-http-lb-config(1)

delete-http-lb-ref(1)

delete-http-listener(1)

delete-http-redirect(1)

delete-iiop-listener(1)

delete-instance(1)

delete-jacc-provider(1)

delete-javamail-resource(1)

delete-jdbc-connection-pool(1)

delete-jdbc-resource(1)

delete-jmsdest(1)

delete-jms-host(1)

delete-jms-resource(1)

delete-jndi-resource(1)

delete-jvm-options(1)

delete-lifecycle-module(1)

delete-local-instance(1)

delete-message-security-provider(1)

delete-network-listener(1)

delete-node-config(1)

delete-node-ssh(1)

delete-password-alias(1)

delete-profiler(1)

delete-protocol(1)

delete-protocol-filter(1)

delete-protocol-finder(1)

delete-resource-adapter-config(1)

delete-resource-ref(1)

delete-schedule(1)

delete-ssl(1)

delete-system-property(1)

delete-threadpool(1)

delete-transport(1)

delete-virtual-server(1)

deploy(1)

deploydir(1)

disable(1)

disable-backup-config(1)

disable-http-lb-application(1)

disable-http-lb-server(1)

disable-monitoring(1)

disable-secure-admin(1)

disable-secure-admin-internal-user(1)

disable-secure-admin-principal(1)

enable(1)

enable-backup-config(1)

enable-http-lb-application(1)

enable-http-lb-server(1)

enable-monitoring(1)

enable-secure-admin(1)

enable-secure-admin-internal-user(1)

enable-secure-admin-principal(1)

export(1)

export-http-lb-config(1)

export-sync-bundle(1)

flush-connection-pool(1)

flush-jmsdest(1)

freeze-transaction-service(1)

generate-jvm-report(1)

get(1)

get-client-stubs(1)

get-health(1)

import-sync-bundle(1)

install-node(1)

jms-ping(1)

list(1)

list-admin-objects(1)

list-application-refs(1)

list-applications(1)

list-audit-modules(1)

list-auth-realms(1)

list-backup-configs(1)

list-backups(1)

list-clusters(1)

list-commands(1)

list-components(1)

list-configs(1)

list-connector-connection-pools(1)

list-connector-resources(1)

list-connector-security-maps(1)

list-connector-work-security-maps(1)

list-containers(1)

list-custom-resources(1)

list-domains(1)

list-file-groups(1)

list-file-users(1)

list-http-lb-configs(1)

list-http-lbs(1)

list-http-listeners(1)

list-iiop-listeners(1)

list-instances(1)

list-jacc-providers(1)

list-javamail-resources(1)

list-jdbc-connection-pools(1)

list-jdbc-resources(1)

list-jmsdest(1)

list-jms-hosts(1)

list-jms-resources(1)

list-jndi-entries(1)

list-jndi-resources(1)

list-jvm-options(1)

list-lifecycle-modules(1)

list-log-attributes(1)

list-log-levels(1)

list-message-security-providers(1)

list-modules(1)

list-network-listeners(1)

list-nodes(1)

list-nodes-config(1)

list-nodes-ssh(1)

list-password-aliases(1)

list-persistence-types(1)

list-probes(1)

list-protocol-filters(1)

list-protocol-finders(1)

list-protocols(1)

list-resource-adapter-configs(1)

list-resource-refs(1)

list-schedules(1)

list-secure-admin-internal-users(1)

list-secure-admin-principals(1)

list-sub-components(1)

list-supported-cipher-suites(1)

list-system-properties(1)

list-threadpools(1)

list-timers(1)

list-transports(1)

list-virtual-servers(1)

list-web-context-param(1)

list-web-env-entry(1)

login(1)

migrate-timers(1)

monitor(1)

multimode(1)

ping-connection-pool(1)

ping-node-ssh(1)

recover-transactions(1)

redeploy(1)

restart-domain(1)

restart-instance(1)

restart-local-instance(1)

restore-domain(1)

resume-domain(1)

rollback-transaction(1)

rotate-log(1)

run-script(1)

set(1)

set-log-attributes(1)

set-log-levels(1)

setup-ssh(1)

set-web-context-param(1)

set-web-env-entry(1)

show-component-status(1)

start-cluster(1)

start-database(1)

start-domain(1)

start-instance(1)

start-local-instance(1)

stop-cluster(1)

stop-database(1)

stop-domain(1)

stop-instance(1)

stop-local-instance(1)

suspend-domain(1)

undeploy(1)

unfreeze-transaction-service(1)

uninstall-node(1)

unset(1)

unset-web-context-param(1)

unset-web-env-entry(1)

update-admin-server-coordinates(1)

update-admin-server-local-coordinates(1)

update-connector-security-map(1)

update-connector-work-security-map(1)

update-file-user(1)

update-node-config(1)

update-node-ssh(1)

update-password-alias(1)

uptime(1)

validate-multicast(1)

verify-domain-xml(1)

version(1)

Oracle GlassFish Server 3.1 Section 1M: Utility Commands

Oracle GlassFish Server 3.1 Section 5ASC: GlassFish Server Concepts

Oracle GlassFish Server 3.1 Section 5GFP: Events

Index

redeploy

- redeploys the specified component

Synopsis

redeploy [--help] 
--name component_name 
[--upload={true|false}]
[--retrieve local_dirpath] 
[--dbvendorname dbvendorname]
[--createtables={true|false}|--dropandcreatetables={true|false}]
[--uniquetablenames={true|false}] 
[--deploymentplan deployment_plan]
[--enabled={true|false}] 
[--generatermistubs={false|true}] 
[--contextroot context_root] 
[--precompilejsp={true|false}] 
[--verify={false|true}]
[--virtualservers virtual_servers] 
[--availabilityenabled={false|true}] 
[--asyncreplication={true|false}]
[--lbenabled={true|false}]
[--keepstate={false|true}]
[--libraries jar_file[,jar_file]*] 
[--target target] 
[--type pkg-type] 
[--properties(name=value)[:name=value]*]
[file_archive|filepath]

Description

The redeploy subcommand 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 subcommand preserves the settings and other options with which the application was originally deployed. The application must already be deployed. Otherwise, an error occurs.

This subcommand is supported in remote mode only.

Options

--help
-?

Displays the help text for the subcommand.

--virtualservers

One or more virtual server IDs. Multiple IDs are separated by commas.

--contextroot

Valid only if the archive is a web module. It is ignored for other archive types; defaults to filename without extension.

--precompilejsp

By default this option does not allow the JSP to be precompiled during deployment. Instead, JSPs are compiled during runtime. Default is false.

--verify

If set to true and the required verifier packages are installed from the Update Tool, the syntax and semantics of the deployment descriptor is verified. Default is false.

--name

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 plus underscore (_), dash (-), and period (.) characters. For more information about module and application versions, see the Module and Application Versions in Oracle GlassFish Server 3.1 Application Deployment Guide.

--upload

Specifies whether the subcommand uploads the file to the DAS. In most situations, this option can be omitted.

Valid values are as follows:

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.

The default value depends on whether the DAS is on the host where the subcommand is run or is on a remote host.

  • 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.

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

--retrieve

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

--dbvendorname

Specifies the name of the database vendor for which tables are created. Supported values include db2, mssql, oracle, derby, javadb, postgresql, and sybase, case-insensitive. If not specified, the value of the database-vendor-name attribute in glassfish-ejb-jar.xml is used. If no value is specified, a connection is made to the resource specified by the jndi-name subelement of the cmp-resource element in the glassfish-ejb-jar.xml file, and the database vendor name is read. If the connection cannot be established, or if the value is not recognized, SQL-92 compliance is presumed.

--createtables

If specified as true, creates tables at deployment of an application with unmapped CMP beans. If specified as false, tables are not created. If not specified, the value of the create-tables-at-deploy entry in the cmp-resource element of the glassfish-ejb-jar.xml file determines whether or not tables are created. No unique constraints are created for the tables.

--dropandcreatetables

If specified as true when the component is redeployed, the tables created by the previous deployment are dropped before creating the new tables. Applies to deployed applications with unmapped CMP beans. If specified as false, tables are neither dropped nor created. If not specified, the tables are dropped if the drop-tables-at-undeploy entry in the cmp-resource element of the glassfish-ejb-jar.xml file is set to true, and the new tables are created if the create-tables-at-deploy entry in the cmp-resource element of the glassfish-ejb-jar.xml file is set to true.

--uniquetablenames

Guarantees unique table names for all the beans and results in a hash code added to the table names. This is useful if you have an application with case-sensitive bean names. Applies to applications with unmapped CMP beans.

--deploymentplan

Deploys the deployment plan, which is a JAR file that contains GlassFish Server descriptors. Specify this option when deploying a pure EAR file. A pure EAR file is an EAR without GlassFish Server descriptors.

--enabled

Allows users to access the application. If set to false, users will not be able to access the application. This option enables the application on the specified target instance or cluster. 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. The default is true.

--generatermistubs

If set to true, static RMI-IIOP stubs are generated and put into the client.jar. If set to false, the stubs are not generated. Default is false.

--availabilityenabled

This option controls whether high-availability is enabled for web sessions and for stateful session bean (SFSB) checkpointing and potentially passivation. If set to false (default) all web session saving and SFSB checkpointing is disabled for the specified application, web application, or EJB module. If set to true, the specified application or module is enabled for high-availability. Set this option to true only if high availability is configured and enabled at higher levels, such as the server and container levels.

--asyncreplication

This option controls whether web session and SFSB states for which high availability is enabled are first buffered and then replicated using a separate asynchronous thread. If set to true (default), performance is improved but availability is reduced. If the instance where states are buffered but not yet replicated fails, the states are lost. If set to false, performance is reduced but availability is guaranteed. States are not buffered but immediately transmitted to other instances in the cluster.

--lbenabled

This option controls whether the deployed application is available for load balancing. The default is true.

--keepstate

This option controls whether web sessions, SFSB instances, and persistently created EJB timers are retained between redeployments.

The default is false. This option is supported only on the default server instance, named server. It is not supported and ignored for any other target.

Some changes to an application between redeployments prevent this feature from working properly. For example, do not change the set of instance variables in the SFSB bean class.

For web applications, this feature is applicable only if in the glassfish-web-app.xml file the persistence-type attribute of the session-manager element is file.

For stateful session bean instances, the persistence type without high availability is set in the server (the sfsb-persistence-type attribute) and must be set to file, which is the default and recommended value.

If any active web session, SFSB instance, or EJB timer fails to be preserved or restored, none of these will be available when the redeployment is complete. However, the redeployment continues and a warning is logged.

To preserve active state data, GlassFish Server serializes the data and saves it in memory. To restore the data, the class loader of the newly redeployed application deserializes the data that was previously saved.

--libraries

A comma-separated list of library JAR files. Specify the library JAR files by their relative or absolute paths. Specify relative paths relative to domain-dir/lib/applibs. The libraries are made available to the application in the order specified.

--target

Specifies the target to which you are deploying. Valid values are:

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, 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.

--type

The packaging archive type of the component that is being deployed. Possible values are as follows:

osgi

The component is packaged as an OSGi Alliance bundle.

The --type option is optional. If the component is packaged as a regular archive, omit this option.

--properties or --property

Optional keyword-value pairs that specify additional properties for the 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 option regardless of the number of properties that you specify.

You can specify the following properties for a deployment:

jar-signing-alias

Specifies the alias for the security certificate with which the application client container JAR file is signed. Java Web Start will not run code that requires elevated permissions unless it resides in a JAR file signed with a certificate that the user's system trusts. For your convenience, GlassFish Server signs the JAR file automatically using the certificate with this alias from the domain's keystore. Java Web Start then asks the user whether to trust the code and displays the GlassFish Server certificate information. To sign this JAR file with a different certificate, add the certificate to the domain keystore, then use this property. For example, you can use a certificate from a trusted authority, which avoids the Java Web Start prompt, or from your own company, which users know they can trust. Default is s1as, the alias for the self-signed certificate created for every domain.

java-web-start-enabled

Specifies whether Java Web Start access is permitted for an application client module. Default is true.

compatibility

Specifies the GlassFish Server release with which to be backward compatible in terms of JAR visibility requirements for applications. The only allowed value is v2, which refers to Sun Java System Application Server version 2 or Sun Java System Application Server version 9.1 or 9.1.1. The Java EE 6 platform specification imposes stricter requirements than Java EE 5 did on which JAR files can be visible to various modules within an EAR file. In particular, application clients must not have access to EJB JAR files or other JAR files in the EAR file unless references use the standard Java SE mechanisms (extensions, for example) or the Java EE library-directory mechanism. Setting this property to v2 removes these Java EE 6 restrictions.

keepSessions={false|true}

Superseded by the --keepstate option.

This property can by 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, GlassFish 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

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.

Operands

file_archive|filepath

The path to the archive that contains the application that is being redeployed. This path can be a relative path or an absolute path.

The archive can be in either of the following formats:

  • An archive file, for example, /export/JEE_apps/hello.war.

    If the --upload option is set to true, this is the path to the deployable file on the local client machine. If the --upload option is set to false, this is the absolute path to the file on the server machine.

  • A directory that contains the exploded format of the deployable archive. This is the absolute path to the directory on the server machine.

    If you specify a directory, the --upload option is ignored.

Whether this operand is required depends on how the application was originally deployed:

  • If the application was originally deployed from a file, the archive-path operand is required. The operand must specify an archive file.

  • If the application was originally deployed from a directory, the archive-path operand is optional.

    The operand can specify a directory or an archive file.

Examples

Example 1 Redeploying a Web Application From a File

This example redeploys the web application hello from the hello.war file in the current working directory. The application was originally deployed from a file. Active sessions of the application are to be preserved and then restored when the redeployment is complete.

asadmin> redeploy --name hello --properties keepSessions=true hello.war
Application deployed successfully with name hello.
Command redeploy executed successfully

Example 2 Redeploying a Web Application From a Directory

This example redeploys the web application hellodir. The application was originally deployed from a directory.

asadmin> redeploy --name hellodir
Application deployed successfully with name hellodir.
Command redeploy executed successfully

Exit Status

0

subcommand executed successfully

1

error in executing the subcommand

See Also

deploy(1), undeploy(1), list-components(1)

asadmin(1M)

Oracle GlassFish Server 3.1 Application Deployment Guide