如何从jboss cli读取引导错误?

问题描述

当通过jboss-cli(print())使用热部署时,如果部署它存在问题,则会有一些描述该问题的输出,例如(实际上打印得不太漂亮。^^):

protected

不使用热部署时,例如在deploy --file on_controller.war中使用{ "WFLYCTL0080: Failed services" => { "jboss.undertow.deployment.default-server.default-host./THE_WAR" => "< some description containing exceptions etc >" } } 时;
如何使用jboss-cli读取此错误?

我知道这里有<fs-archive />命令,但这只告诉部署是否失败,却没有原因
我也尝试过standlone.xml,但它仅包含部署是否​​失败。

另外deployment-info将返回/deployment=*:query(),即使在引导过程中出错。

解决方法

您可以尝试/core-service=management:read-boot-errors

[standalone@jboss:9990 /] /core-service=management:read-boot-errors
{
    "outcome" => "success","result" => []
}

由于输出可能难以解析when using automation,因此您也可以使用JBoss的HTTP Management API,它将为您提供JSON:

$ curl --digest --location --dump-header - http://$JBOSS_HOST:9990/management/ \
    --header "Content-Type: application/json" --data - --user admin <<EOT
{
    "address": {
        "core-service": "management"
    },"operation": "read-boot-errors","json.pretty": 1
}
EOT

HTTP/1.1 401 Unauthorized
Connection: keep-alive
WWW-Authenticate: Digest realm="ManagementRealm",nonce="--%<--",opaque="00000000000000000000000000000000",algorithm=MD5,qop=auth
X-Frame-Options: SAMEORIGIN
Content-Length: 77
Content-Type: text/html
Date: Thu,13 Aug 2020 10:29:33 GMT

HTTP/1.1 200 OK
Connection: keep-alive
X-Frame-Options: SAMEORIGIN
Content-Type: application/json; charset=utf-8
Content-Length: 48
Date: Thu,13 Aug 2020 10:29:33 GMT

{
    "outcome" : "success","result" : []
}

({<<EOT ... EOTheredoc,其余命令是from the documentation

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...