JBoss JMX twiddle Runtime未注册

时间:2011-05-30 11:46:58

标签: jboss jmx

我在Solaris 10服务器上遇到twiddle脚本的问题。 我必须阅读一些属性,例如jboss.system和其他属性。 依赖于jboss服务器的所有属性都很好,但是当我尝试时 要从java.lang读取属性,会发生以下错误:

javax.management.InstanceNotFoundException: java.lang:type=Runtime is not registered.

1 个答案:

答案 0 :(得分:3)

问题是 java.lang:type = Runtime Platform MBeanServer 注册的MBean,默认情况下,twiddle将您连接到 JBoss MBeanServer 默认情况下,不会注册RuntimeMXBean服务器。

解决此问题的最简单方法(假设您只想访问系统属性)是指向JBoss MBean jboss:name=SystemProperties,type=Service。 MBean暴露:

String get(String key)
String get(String key, String default)

或检索所有值,

Map shopwAll()

其他更费力的解决方案将包括:

  • 在JBoss MBeanServer中注册Platform MBeanServer MXBeans。见Question
  • 在JVM中启用管理代理程序,并使用JMX Connector连接到Platform MBeanServer。见Question
  • 使用Attach API按进程ID连接到JBoss服务器的Platform MBeanServer。然后,您可以引用MXRuntime MBean。
相关问题