Service:jmx:rmi:///jndi/rmi

Source: Internet
Author: User

Service:jmx:rmi:///jndi/rmi://ip:9889/jmxrmi

Http://stackoverflow.com/questions/2768087/explain-jmx-url

According to Javax.management.remote.rmi

This URL is assembled

service:jmx:rmi://ignoredhost/jndi/rmi://myhost/myname
67down VoteAccepted

I'll reuse an answer I wrote up earlier for this question:cannot connect to Tomcat's Mbeanserver via Jconsole in Java6

It ' s not complete, but might help:

Suppose you has the JMX Server (alias ' jmx Agent ' alias ' The JVM you want to connect to ') running on ' TARGET machine ' wit H the RMI registry Port at ' RMI Registry Port ' and the jmx RMI Server port at ' jmx RMI Server Port '.

Note:

    1. The RMI registry tells JMX clients where to find the jmx RMI server Port; Information can obtained under key jmxrmi .
    2. The RMI registry port is generally known as it was set through system properties at the JVM startup.
    3. The JMX RMI server port is generally not known as the JVM chooses it in random (if no other precautions is taken).

The following URI would leads to successful connection (tested)

service:jmx:rmi://<TARGET_MACHINE>:<JMX_RMI_SERVER_PORT>/jndi/rmi://<TARGET_MACHINE>:<RMI_REGISTRY_PORT>/jmxrmi

This looks nasty. Let ' s cut it apart.

This URI is a RFC2609 "Service location Protocol URL" (well, it's really a URI, right?)

It is composed of:

    • service-A constant
    • jmx:rmi-The service type composed of: abstract type jmx and URL schemermi
    • The Rest-the SAP (Service Access Protocol specification)

SAP is decomposed into:

    • //<TARGET_MACHINE>:<JMX_RMI_SERVER_PORT>-Ipsite
    • /jndi/rmi://<TARGET_MACHINE>:<RMI_REGISTRY_PORT>/jmxrmi-URL part

A well-informed JMX client connects to the ' Ipsite ' to do jmx-over-rmi exchanges; But what is the JMX client that doesn ' t KNOW that port? Patience ...

URL part was decomposed into:

    • /jndi/-This seems to tell the JMX client, it can get lookup information at the location that follows
    • rmi://<TARGET_MACHINE>:<RMI_REGISTRY_PORT>/jmxrmi-YEP, we get information about the JMX RMI Server at the RMI registry, under the lookup keyjmxrmi

This is somewhat cart-before-horse, as one have to contact the RMI registry given by the latter part of T He SLP URL first.

After scratching head, intuitively, let's try:

service:jmx:rmi://<TARGET_MACHINE>/jndi/rmi://<TARGET_MACHINE>:<RMI_REGISTRY_PORT>/jmxrmi

Yes, that's works! The JMX RMI server port is nicely obtained from the registry. On second thoughts, the target machine should also is obtained from the registry, thus:

service:jmx:rmi:///jndi/rmi://<TARGET_MACHINE>:<RMI_REGISTRY_PORT>/jmxrmi

Even better, that works, too!

References:

    1. Http://download.oracle.com/javase/6/docs/api/javax/management/remote/rmi/package-summary.html
    2. Http://download.oracle.com/javase/6/docs/api/javax/management/remote/JMXServiceURL.html
    3. Http://mx4j.sourceforge.net/docs/ch03s04.html
    4. Http://download.oracle.com/javase/6/docs/technotes/guides/management/agent.html#gdevg
    5. Http://www.rfc-editor.org/rfc/rfc2609.txt

Service:jmx:rmi:///jndi/rmi

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.