Oracle GlassFish Server 3.0.1 Application Development Guide

The sun-appserv-undeploy Task

Undeploys any of the following from a local or remote GlassFish Server instance.

Subelements of sun-appserv-undeploy

The following table describes subelements for the sun-appserv-undeploy task. These are objects upon which this task acts.

Table 3–3 The sun-appserv-undeploy Subelements

Element 

Description 

The server Subelement

A GlassFish Server instance 

The component Subelement

A component to be deployed 

The fileset Subelement

A set of component files that match specified parameters 

Attributes of sun-appserv-undeploy

The following table describes attributes for the sun-appserv-undeploy task.

Table 3–4 The sun-appserv-undeploy Attributes

Attribute 

Default 

Description 

name

file name without extension 

(optional if a component or fileset subelement is present or the file attribute is specified, otherwise required) The display name for the component being undeployed.

file

none 

(optional) The component to undeploy. If this attribute refers to a file, it must be a valid archive. If this attribute refers to a directory, it must contain a valid archive in which all components have been exploded. 

droptables

sun-ejb-jar.xml entry

(optional) If true, causes database tables that were automatically created when the bean(s) were last deployed to be dropped when the bean(s) are undeployed. If false, does not drop tables.

If not specified, the value of the drop-tables-at-undeploy attribute in sun-ejb-jar.xml is used.

For details, see Generation Options and Generation Options for CMP.

cascade

false

(optional) If true, deletes all connection pools and connector resources associated with the resource adapter being undeployed.

If false, undeployment fails if any pools or resources are still associated with the resource adapter.

This attribute is applicable to connectors (resource adapters) and applications with connector modules. 

user

admin

(optional) The user name used when logging into the GlassFish Server administration instance. This attribute is inherited by nested server elements.

passwordfile

none 

(optional) File containing passwords. The password from this file is retrieved for communication with the GlassFish Server administration instance. This attribute is inherited by nested server elements.

host

localhost

(optional) Target server. When deploying to a remote server, use the fully qualified host name. This attribute is inherited by nested server elements.

port

4848

(optional) The administration port on the target server. This attribute is inherited by nested server elements.

target

name of default instance 

(optional) Target server instance. This attribute is inherited by nested server elements.

asinstalldir

see description 

(optional) The installation directory for the local GlassFish Server installation, which is used to find the administrative classes. If not specified, the command checks to see if the asinstalldir parameter has been set. Otherwise, administrative classes must be in the system classpath.

Examples of sun-appserv-undeploy

Here is a simple application undeployment script with many implied attributes:

<sun-appserv-undeploy name="simpleapp" passwordfile="${passwordfile}" />

Here is an equivalent script showing all the implied attributes:

<sun-appserv-undeploy
 name="simpleapp"
 user="admin"
 passwordfile="${passwordfile}"
 host="localhost"
 port="4848"
 target="${default-instance-name}"
 asinstalldir="${asinstalldir}" />

This example demonstrates using the archive files (EAR and WAR, in this case) for the undeployment, using the component name (for undeploying the EJB component in this example), and undeploying multiple components.

<sun-appserv-undeploy passwordfile="${passwordfile}">
 <component file="${assemble}/simpleapp.ear"/>
 <component file="${assemble}/simpleservlet.war"/>
 <component name="simplebean" />
</sun-appserv-undeploy>

As with the deployment process, components can be undeployed from multiple servers in a single command. This example shows the same three components being removed from two different instances of the GlassFish Server. In this example, the passwords for both instances are the same.

<sun-appserv-undeploy passwordfile="${passwordfile}">
 <server host="greg.oracle.com"/>
 <server host="joe.oracle.com"/>
 <component file="${assemble}/simpleapp.ear"/>
 <component file="${assemble}/simpleservlet.war"/>
 <component name="simplebean" />
</sun-appserv-undeploy>