简体   繁体   English

Tomcat中JMX的RMI存根

[英]RMI stub for JMX in tomcat

I am creating an RMI stub for JMX similar to the instructions in this blog post , and it opens a listening port as expected. 我正在为JMX创建一个RMI存根,类似于本博文中的说明,它按预期打开了一个侦听端口。 When I try to connect to the port with JMX I get the following error: 当我尝试使用JMX连接到端口时,出现以下错误:

java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: jmxrmi
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:340)
        at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
        at ....
Caused by: javax.naming.NameNotFoundException: jmxrmi
        at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:99)
        at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1888)
        at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1858)
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)
... 2 more

Is there any way for me to debug the RMI server and see why that name can't be found? 我有什么方法可以调试RMI服务器,看看为什么找不到该名称?

Thanks 谢谢

Turns out that one of the configuration options was pointing to a file that didn't exist. 原来,配置选项之一指向的文件不存在。 JMX fell over silently :( JMX默默倒下:(

Looks like you left out a ':'. 好像您遗漏了':'。 You should have service:jmx:rmi ... 您应该有service:jmx:rmi ...

The name of the connector is the last part of the URL (in the blog post it's "connector"). 连接器的名称是URL的最后一部分(在博客文章中为“连接器”)。 Change that to "jmxrmi". 将其更改为“ jmxrmi”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM