For Message Queue applications (which always use the RMI protocol for JMX connections), the JMX service URL has the following syntax:
service:jmx:rmi://[host[:port]][urlPath]
Although host and port may be included, they are ignored by the RMI protocol. If urlPath is specified, it gives the Java Naming and Directory Interface (JNDI) location of an RMI stub (typically a location within an RMI registry) in the form
/jndi/jndiName
For example, the URL
service:jmx:rmi://myhost/jndi/rmi://myhost:1099/myhost/myjmxconnector
specifies an RMI stub at the location
rmi://myhost:1099/myhost/myjmxconnector
which is an RMI registry running at location myhost/myjmxconnector on port 1099 of host myhost.
Alternatively, if urlPath is omitted from the service URL, the JMX connector server will generate a client URL containing the actual RMI stub embedded within it in encoded and serialized form. For example, the service URL
service:jmx:rmi://localhost
will generate a client URL of the form
service:jmx:rmi://localhost/stub/rmiStub
where rmiStub is an encoded and serialized representation of the RMI stub itself.