Vinay Vishal | 7c4c4fc | 2019-01-28 12:01:04 +0530 | [diff] [blame] | 1 | type=page |
| 2 | status=published |
| 3 | title=undeploy |
| 4 | next=unfreeze-transaction-service.html |
| 5 | prev=stop-local-instance.html |
| 6 | ~~~~~~ |
| 7 | undeploy |
| 8 | ======== |
| 9 | |
| 10 | [[undeploy-1]][[GSRFM00244]][[undeploy]] |
| 11 | |
| 12 | undeploy |
| 13 | -------- |
| 14 | |
| 15 | removes a deployed component |
| 16 | |
| 17 | [[sthref2189]] |
| 18 | |
| 19 | Synopsis |
| 20 | |
| 21 | [source,oac_no_warn] |
| 22 | ---- |
| 23 | asadmin [asadmin-options] undeploy [--help] |
| 24 | [--target target] [--droptables={true|false}] |
| 25 | [--cascade={false|true}] name |
| 26 | ---- |
| 27 | |
| 28 | [[sthref2190]] |
| 29 | |
| 30 | Description |
| 31 | |
| 32 | The `undeploy` subcommand uninstalls a deployed application or module |
| 33 | and removes it from the repository. |
| 34 | |
| 35 | This subcommand is supported in remote mode only. |
| 36 | |
| 37 | [[sthref2191]] |
| 38 | |
| 39 | Options |
| 40 | |
| 41 | asadmin-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 | |
| 78 | Operands |
| 79 | |
| 80 | name:: |
| 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 | |
| 94 | Examples |
| 95 | |
| 96 | [[GSRFM769]][[sthref2194]] |
| 97 | |
| 98 | Example 1 Undeploying an Enterprise Application |
| 99 | |
| 100 | This example undeploys an enterprise application named `Cart.ear`. |
| 101 | |
| 102 | [source,oac_no_warn] |
| 103 | ---- |
| 104 | asadmin> undeploy Cart |
| 105 | Command undeploy executed successfully. |
| 106 | ---- |
| 107 | |
| 108 | [[GSRFM770]][[sthref2195]] |
| 109 | |
| 110 | Example 2 Undeploying an Enterprise Bean With Container-Managed |
| 111 | Persistence (CMP) |
| 112 | |
| 113 | This example undeploys a CMP bean named `myejb` and drops the |
| 114 | corresponding database tables. |
| 115 | |
| 116 | [source,oac_no_warn] |
| 117 | ---- |
| 118 | asadmin> undeploy --droptables=true myejb |
| 119 | Command undeploy executed successfully. |
| 120 | ---- |
| 121 | |
| 122 | [[GSRFM771]][[sthref2196]] |
| 123 | |
| 124 | Example 3 Undeploying a Connector (Resource Adapter) |
| 125 | |
| 126 | This example undeploys the connector module named `jdbcra` and performs |
| 127 | a cascading delete to remove the associated resources and connection |
| 128 | pools. |
| 129 | |
| 130 | [source,oac_no_warn] |
| 131 | ---- |
| 132 | asadmin> undeploy --cascade=true jdbcra |
| 133 | Command undeploy executed successfully. |
| 134 | ---- |
| 135 | |
| 136 | [[sthref2197]] |
| 137 | |
| 138 | Exit Status |
| 139 | |
| 140 | 0:: |
| 141 | subcommand executed successfully |
| 142 | 1:: |
| 143 | error in executing the subcommand |
| 144 | |
| 145 | [[sthref2198]] |
| 146 | |
| 147 | See Also |
| 148 | |
| 149 | link:asadmin.html#asadmin-1m[`asadmin`(1M)] |
| 150 | |
| 151 | link:deploy.html#deploy-1[`deploy`(1)], |
| 152 | link:list-components.html#list-components-1[`list-components`(1)], |
| 153 | link:redeploy.html#redeploy-1[`redeploy`(1)] |
| 154 | |
| 155 | link:../application-deployment-guide/toc.html#GSDPG[GlassFish Server Open Source Edition Application Deployment |
| 156 | Guide] |
| 157 | |
| 158 | |