我有一个Infinispan Server,版本是6.0.x,它是从JBoss 7.2派生的,并且可以很好地进行缓存。

但是,当我尝试通过JMX监视它时,我无法。这是我在jconsole.bat中输入的URL:

service:jmx:remoting-jmx://MY.IP.ADDRESS.HERE:9999


但是我得到这个错误:

Exception in thread "VMPanel.connect" java.util.ServiceConfigurationError: javax.management.remote.JMXConnectorProvider: Provider org.jboss.remotingjmx.RemotingConnectorProvider could not be instantiated: java.lang.NoClassDefFoundError: org/jboss/logging/Logger
    at java.util.ServiceLoader.fail(ServiceLoader.java:224)
    at java.util.ServiceLoader.access$100(ServiceLoader.java:181)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:377)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
    at javax.management.remote.JMXConnectorFactory.getConnectorAsService(JMXConnectorFactory.java:472)
    at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:341)
    at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:267)
    at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:370)
    at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:313)
    at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:292)
Caused by: java.lang.NoClassDefFoundError: org/jboss/logging/Logger
    at org.jboss.remotingjmx.RemotingConnectorProvider.<clinit>(RemotingConnectorProvider.java:42)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:374)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373)
    ... 7 more
Caused by: java.lang.ClassNotFoundException: org.jboss.logging.Logger
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 14 more
Exception in thread "VMPanel.connect" java.util.ServiceConfigurationError: javax.management.remote.JMXConnectorProvider: Provider org.jboss.remotingjmx.RemotingConnectorProvider could not be instantiated: java.lang.NoClassDefFoundError: Could not initialize class org.jboss.remotingjmx.RemotingConnectorProvider
    at java.util.ServiceLoader.fail(ServiceLoader.java:224)
    at java.util.ServiceLoader.access$100(ServiceLoader.java:181)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:377)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
    at javax.management.remote.JMXConnectorFactory.getConnectorAsService(JMXConnectorFactory.java:472)
    at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:341)
    at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:267)
    at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:357)
    at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:313)
    at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:292)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jboss.remotingjmx.RemotingConnectorProvider
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:374)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373)
    ... 7 more


也许我应该在某个地方创建一些托管bean?我怎样才能解决这个问题?

备注1:在文档中,它们包括<global></global>之间的necearry配置,但在我的情况下,设置应遵循JBoss Schema ...

备注2:我尝试使用JBoss 7.2,它可以显示图形等,并且可以使用相同的URL。区别在于我使用的是JBoss的jconsole.bat而不是Infinispan。

请对必要的配置有任何想法吗?

谢谢。

最佳答案

我是Windows 7用户,这是对我有用的修复程序。
打开jconsole.bat进行编辑。
在顶部,打开回声。

@echo on


然后下去找到这条线

call :SearchForJars "%JBOSS_MODULEPATH%\system\layers\base\org\jboss\logging\main"


在其前面插入以下行:

echo "%JBOSS_MODULEPATH%\system\layers\base\org\jboss\logging\main"


我不确定为什么行得通,但确实如此。如果您收到不同的ClassNotFound异常,请在其他jar搜索上方尝试echo语句。

关于java - Infinispan Server:如何启用JMX监视?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22901772/

10-12 06:10