简体   繁体   English

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

[英]How to read boot errors from jboss cli?

When using hot-deploy via jboss-cli ( deploy --file on_controller.war ) and there is a problem with deploying it, there is some output describing the problem, for example (not actually that pretty printed. ^^):当通过 jboss-cli ( deploy --file on_controller.war ) 使用 hot-deploy 并且部署它时出现问题,有一些 output 描述了这个问题,例如(实际上并不是那么漂亮。^^):

{
    "WFLYCTL0080: Failed services" => {
        "jboss.undertow.deployment.default-server.default-host./THE_WAR" =>
            "< some description containing exceptions etc >"
    }
}

When not using hot-deploy, for example when using <fs-archive /> in standlone.xml ;不使用热部署时,例如在standlone.xml中使用<fs-archive />时;
how do I read this errors using jboss-cli?如何使用 jboss-cli 读取此错误?

I know there is the deployment-info command, but that only tells whether a deployment failed, but not why .我知道有deployment-info命令,但它只告诉部署是否失败,而不是为什么
I also tried /deployment=*:query() , but it also just contains only whether the deployment failed.我也试过/deployment=*:query() ,但它也只包含部署是否失败。

Additionally :read-attribute(server-state) will return "running" even when were error during boot.此外:read-attribute(server-state)将返回"running" ,即使在引导期间出现错误也是如此。

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

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

Because that output can be a little bit hard to parse when using automation , you can also use JBoss' HTTP Management API , which will give you JSON: Because that output can be a little bit hard to parse when using automation , you can also use JBoss' HTTP Management API , which will give you 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... EOT is a heredoc , the rest of the command is from the documentation ) <<EOT... EOT是一个heredoc ,命令的rest 来自文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM