blob: b844bdc08595b96ef3a6da888505418953cadebc [file] [log] [blame]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +05301type=page
2status=published
3title=undeploy
4next=unfreeze-transaction-service.html
5prev=stop-local-instance.html
6~~~~~~
7undeploy
8========
9
10[[undeploy-1]][[GSRFM00244]][[undeploy]]
11
12undeploy
13--------
14
15removes a deployed component
16
17[[sthref2189]]
18
19Synopsis
20
21[source,oac_no_warn]
22----
23asadmin [asadmin-options] undeploy [--help]
24[--target target] [--droptables={true|false}]
25[--cascade={false|true}] name
26----
27
28[[sthref2190]]
29
30Description
31
32The `undeploy` subcommand uninstalls a deployed application or module
33and removes it from the repository.
34
35This subcommand is supported in remote mode only.
36
37[[sthref2191]]
38
39Options
40
41asadmin-options::
42 Options for the `asadmin` utility. For information about these
43 options, see the link:asadmin.html#asadmin-1m[`asadmin`(1M)] help page.
44`--help`::
45`-?`::
46 Displays the help text for the subcommand.
47`--cascade`::
48 If set to `true`, deletes all the connection pools and connector
49 resources associated with the resource adapter being undeployed. If
50 set to `false`, the undeploy fails if any pools and resources are
51 still associated with the resource adapter. Then, either those pools
52 and resources must be deleted explicitly, or the option must be set to
53 `true`. If the option is set to `false`, and if there are no pools and
54 resources still associated with the resource adapter, the resource
55 adapter is undeployed. This option is applicable to connectors
56 (resource adapters) and applications. Default value is false.
57`--droptables`::
58 If set to true, drops the tables that the application created by using
59 CMP beans during deployment. If set to false, tables are not dropped.
60 If not specified, the value of the `drop-tables-at-deploy` entry in
61 the `cmp-resource` element of the `glassfish-ejb-jar.xml` file
62 determines whether or not tables are dropped. Default value is true.
63`--target`::
64 Specifies the target from which you are undeploying. Valid values are: +
65 `server`;;
66 Undeploys the component from the default server instance `server`
67 and is the default value.
68 `domain`;;
69 Undeploys the component from the domain.
70 cluster_name;;
71 Undeploys the component from every server instance in the cluster.
72 instance_name;;
73 Undeploys the component from a particular stand-alone server
74 instance.
75
76[[sthref2192]]
77
78Operands
79
80name::
81 Name of the deployed component. +
82 The name can include an optional version identifier, which follows the
83 name and is separated from the name by a colon (`:`). The version
84 identifier must begin with a letter or number. It can contain
85 alphanumeric characters plus underscore (`_`), dash (`-`), and period
86 (`.`) characters. To delete multiple versions, you can use an asterisk
87 (`*`) as a wildcard character. For more information about module and
88 application versions, see "link:../application-deployment-guide/overview.html#GSDPG00324[Module and Application
89 Versions]" in GlassFish Server Open Source Edition Application
90 Deployment Guide.
91
92[[sthref2193]]
93
94Examples
95
96[[GSRFM769]][[sthref2194]]
97
98Example 1   Undeploying an Enterprise Application
99
100This example undeploys an enterprise application named `Cart.ear`.
101
102[source,oac_no_warn]
103----
104asadmin> undeploy Cart
105Command undeploy executed successfully.
106----
107
108[[GSRFM770]][[sthref2195]]
109
110Example 2   Undeploying an Enterprise Bean With Container-Managed
111Persistence (CMP)
112
113This example undeploys a CMP bean named `myejb` and drops the
114corresponding database tables.
115
116[source,oac_no_warn]
117----
118asadmin> undeploy --droptables=true myejb
119Command undeploy executed successfully.
120----
121
122[[GSRFM771]][[sthref2196]]
123
124Example 3   Undeploying a Connector (Resource Adapter)
125
126This example undeploys the connector module named `jdbcra` and performs
127a cascading delete to remove the associated resources and connection
128pools.
129
130[source,oac_no_warn]
131----
132asadmin> undeploy --cascade=true jdbcra
133Command undeploy executed successfully.
134----
135
136[[sthref2197]]
137
138Exit Status
139
1400::
141 subcommand executed successfully
1421::
143 error in executing the subcommand
144
145[[sthref2198]]
146
147See Also
148
149link:asadmin.html#asadmin-1m[`asadmin`(1M)]
150
151link:deploy.html#deploy-1[`deploy`(1)],
152link:list-components.html#list-components-1[`list-components`(1)],
153link:redeploy.html#redeploy-1[`redeploy`(1)]
154
155link:../application-deployment-guide/toc.html#GSDPG[GlassFish Server Open Source Edition Application Deployment
156Guide]
157
158