首页 > 解决方案 > 无法通过 Wildfly swarm/thorntail 中的 jmx 访问数据源 mbean

问题描述

我正在尝试为我的 wildfly swarm 组件启用 JMX。我习惯于看到用于各种 wildfly 子系统的多个 mbean,我对数据源 mbean 特别感兴趣。

我在下面粘贴了一个片段,我得到了 jmx 分数并且我已经statistics-enabled设置为 true。当 thorntail 运行时,我可以通过 JMX 连接到 JVM,但我看不到任何数据源 mbean。是否需要启用其他功能才能显示它们?

该应用程序目前在 swarm 2018.2.0.Final

swarm:
  jmx:
    expression-expose-model.domain-name: RemoteJMX
    jmx-remoting-connector:
      use-management-endpoint: true
    resolved-expose-model.domain-name: RemoteJMX
    show-model: true
  datasources:
    data-sources:
      MyDataSourceName:
        driver-name: com.microsoft.sqlserver
        connection-url: jdbc:xyz
        statistics-enabled: true

标签: jmxwildfly-swarmthorntail

解决方案


首先,WildFly Swarm 2018.2.0.Final 已经老了。与此同时,WildFly Swarm 更名为 Thorntail;您可以通过运行自动迁移mvn io.thorntail:thorntail-maven-plugin:2.5.0.Final:migrate-from-wildfly-swarm

然后:如果您连接到 JMX,您是否看到任何 WildFly MBean?我的意思是,只是数据源的问题,还是更普遍的问题?

在引导期间,您应该会看到与 JMX 相关的日志消息,例如JMX not configured for remote accessJMX configured for remote connector: implicitly using ... interface。你看到他们中的任何一个吗?

最后,您似乎希望在管理端口上公开 JMX。你对management分数有依赖性吗?


推荐阅读