为什么 Hawtio UI 为空(以及 Jolokia 管理端点响应)?

问题描述 投票:0回答:1

我正在将 Hawtio 嵌入到我的 Camel Spring Boot 应用程序中。我按照 Hawtio 入门指南 来设置配置,但出现了问题,因为当我启动 Hawtio UI 时它是空的(没有指标)。我将以下属性添加到 application.properties:

spring.jmx.enabled=true
management.endpoints.web.exposure.include=info,health,camelroutes,prometheus,hawtio,jolokia

以及以下依赖项:

<dependency>
  <groupId>io.hawt</groupId>
  <artifactId>hawtio-springboot</artifactId>
  <version>4.0.0</version>
</dependency>
<dependency>
  <groupId>org.apache.camel.springboot</groupId>
  <artifactId>camel-management-starter</artifactId>
</dependency>
<dependency>
  <groupId>org.apache.camel.springboot</groupId>
  <artifactId>camel-spring-boot-xml-starter</artifactId>
</dependency>

Hawtio 从 Jolokia 管理端点提取数据,该端点返回以下响应:

{“请求”:{“类型”:“版本”},“值”:{“代理”:“2.0.2”,“协议”:“7.3”,“详细信息”:{“代理版本”:“2.0 .2","agent_id":"192.168.0.115-49016-52f67539-servlet","server_product":"jetty","server_vendor":"Eclipse","server_version":"12.0.6","secured": false,"url":"http://192.168.0.115:8081/xxxxx/jolokia"},"id":"192.168.0.115-49016-52f67539-servlet","config":{"agentId":"192.168 .0.115-49016-52f67539-servlet","allowErrorDetails":"false","includeStackTrace":"false"},"info":{"proxy":{},"jmx":{}}},"状态“:200,”时间戳“:1715131260}

正如你所看到的,JMX对象是空的,但是为什么呢?我在 JConsole 中看到了所有 MBean。

拉出 Hawtio UI 时,我在日志中没有看到任何错误或有趣的消息:

2024-05-07T18:27:20.252-07:00 DEBUG 49016 --- [xxxxx] [  XNIO-1 task-2] 
io.hawt.web.auth.LoginRedirectFilter     : Check if path [/xxxxx/hawtio/index.html] 
requires redirect

2024-05-07T18:27:20.252-07:00 DEBUG 49016 --- [xxxxx] [  XNIO-1 task-2] 
io.hawt.web.filters.BaseTagHrefFilter    : baseTagHref = /xxxxx/hawtio

2024-05-07T18:27:20.274-07:00 DEBUG 49016 --- [xxxxx] [  XNIO-1 task-2] 
io.hawt.web.auth.SessionExpiryFilter     : Accessing 
[/xxxxx/hawtio/static/js/main.d0c4c242.js], hawtio 

或者当我到达 Jolokia 端点时。就这样:

2024-05-07T18:23:50.315-07:00 DEBUG 49016 --- [xxxxx] [  XNIO-1 task-2] 
io.hawt.web.auth.AuthenticationFilter    : Handling request for path: /xxxxx/jolokia

2024-05-07T18:23:50.315-07:00 DEBUG 49016 --- [xxxxx] [  XNIO-1 task-2] 
io.hawt.web.auth.AuthenticationFilter    : No authentication needed for path: /xxxxx/jolokia

一切看起来都不错,那么我错过了什么?任何帮助将不胜感激。谢谢!

骆驼版本:4.5 霍蒂奥:4.0.0 春季启动:3.2.3 乔洛基亚:2.0.2

spring-boot apache-camel hawtio jolokia
1个回答
0
投票

您可以首先将您的应用程序与正在运行的官方 Spring Boot 示例进行比较: https://github.com/hawtio/hawtio/tree/hawtio-4.0.0/examples/springboot

一个检查点:

  • 您是否已将

    spring-boot-starter-actuator
    添加到依赖项中?

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    
© www.soinside.com 2019 - 2024. All rights reserved.