简体   繁体   中英

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. When I try to connect to the port with JMX I get the following error:

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?

Thanks

Turns out that one of the configuration options was pointing to a file that didn't exist. JMX fell over silently :(

Looks like you left out a ':'. You should have service:jmx:rmi ...

The name of the connector is the last part of the URL (in the blog post it's "connector"). Change that to "jmxrmi".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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