官术网_书友最值得收藏!

Undeploying an application via the CLI

In this recipe, we will learn how to undeploy an application using the CLI. As per the deploy command, we will use just the basic available options. We will analyze the undeploy command deeply, later in the book.

Getting ready

This recipe follows the previous one, which is Deploying an application via CLI. This means that we will find the example application ready to be undeployed. If you skipped the previous recipe, follow the instructions that it provides, or alternatively provide yourself with an application to undeploy.

How to do it…

  1. With your WildFly instance up and running, open a terminal and connect to the CLI as usual:
    $ ./bin/jboss-cli.sh --connect
    [standalone@localhost:9990 /]
  2. Now we need to tell the CLI to undeploy our application as follows:
    [standalone@localhost:9990 /] undeploy example.war
    [standalone@localhost:9990 /]
  3. And the server.log logs the following:
    23:19:50,912 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0022: Unregistered web context: /example
    23:19:50,961 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-2) HV000001: Hibernate Validator 5.1.3.Final
    23:19:51,010 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0028: Stopped deployment example.war (runtime-name: example.war) in 115ms
    23:19:51,058 INFO  [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0002: Content removed from location /home/luigi/WFC/wildfly/standalone/data/content/21/7dd6250d5bc4afcabdffb0b25c99db92239b5a/content
    23:19:51,059 INFO  [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0009: Undeployed "example.war" (runtime-name: "example.war")

There's more…

If you did a copy and paste of the previous command, you wouldn't have noticed a helpful feature of the undeploy command.

You can tell the CLI to list all the deployments first, so you can choose the right one to undeploy using the following command:

[standalone@localhost:9990 /] undeploy -l
NAME        RUNTIME-NAME ENABLED STATUS
example.war example.war  true    OK     

[standalone@localhost:9990 /]
主站蜘蛛池模板: 绍兴县| 班戈县| 陵川县| 安康市| 凤台县| 永康市| 阆中市| 安新县| 林西县| 桐城市| 来凤县| 神木县| 遂宁市| 三亚市| 和平县| 洱源县| 安化县| 亳州市| 邯郸市| 新田县| 江油市| 蒲江县| 东宁县| 普洱| 陆川县| 江都市| 榆中县| 万载县| 策勒县| 卫辉市| 正宁县| 上饶市| 和政县| 怀宁县| 玛曲县| 昭觉县| 安泽县| 茂名市| 卢龙县| 高邮市| 云和县|