![](/img/trans.png)
[英]jboss-cli : How do I read one specific system property using jboss-cli?
[英]How to read boot errors from jboss cli?
當通過 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 >"
}
}
不使用熱部署時,例如在standlone.xml
中使用<fs-archive />
時;
如何使用 jboss-cli 讀取此錯誤?
我知道有deployment-info
命令,但它只告訴部署是否失敗,而不是為什么。
我也試過/deployment=*:query()
,但它也只包含部署是否失敗。
此外:read-attribute(server-state)
將返回"running"
,即使在引導期間出現錯誤也是如此。
您可以嘗試/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:
$ 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" : []
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.