After installing the Enterprise Server and starting a domain, you can deploy (install) Java EE applications and modules. During deployment and as the application is changed, an application or module can go through the following stages:
Before deploying an application or module, start the domain.
Deploy (install) an application or module to a specific stand-alone server instance or cluster. Because applications and modules are packaged in archive files, specify the archive file name during deployment. The default is to deploy to the default server instance server.
You can also deploy to the domain using the asadmin deploy or asadmin deploydir command or the Admin Console. In the cluster profile, the preselected deployment target is server. To deploy only to the domain, specify no target. If you deploy the application or module only to the domain, it exists in the domain’s central repository, but no server instances or clusters reference it until you add references.
Deployment is dynamic: you don’t need to restart the server instance after deploying application or module for applications to be available. If you do restart, all deployed applications and modules are still deployed and available.
Enabling or Disabling
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 after deployment. For more information, see Disabling a Deployed Application or Module.
Adding or Deleting Targets for a Deployed Application or Module
Once deployed, the application or module exists in the central repository and can be referenced by a number of server instances and/or clusters. Initially, the server instances or clusters you deployed to as targets reference the application or module.
To change which server instances and clusters reference an application or module after it is deployed, change an application or module’s targets using the Admin Console, or change the application references using the asadmin tool. Because the application itself is stored in the central repository, adding or deleting targets adds or deletes the same version of an application on different targets. However, an application deployed to more than one target can be enabled on one and disabled on another, so even if an application is referenced by a target, it is not available to users unless it is enabled on that target.
To replace a deployed application or module, redeploy it. Redeploying automatically undeploys the previously deployed application or module and replaces it with the new one.
When redeploying through the Admin Console, the redeployed application or module is deployed to the domain, and all stand-alone or clustered server instances that reference it automatically receive the new version if dynamic reconfiguration is enabled. If using the asadmin deploy command to redeploy, specify domain as the target.
If an application is deployed on one target only and you are redeploying using asadmin, specify the same target during redeployment.
For production environments, perform a rolling upgrade, which upgrades the application or module without interruption in service. For more information, see To Upgrade Components Without Loss of Service in Sun GlassFish Enterprise Server 2.1 High Availability Administration Guide.
To uninstall an application or module, undeploy it.