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 like this

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

I will 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 have the JMX Server (alias 'JMX Agent' alias 'the JVM you want to connect to') running on 'TARGET MACHINE' with 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 be obtained under key jmxrmi.
  2. The RMI registry port is generally known as it is set through system properties at JVM startup.
  3. The JMX RMI server port is generally not known as the JVM chooses it at random (if no other precautions are taken).

The following URI will lead 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 an RFC2609 "Service Location Protocol URL" (well, it's really an URI, right?)

It is composed of:

  • service - a constant
  • jmx:rmi - the service type composed of: abstract type jmx and URL scheme rmi
  • 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 of the JMX client that doesn't KNOW that port? Patience...

URL part is decomposed into:

  • /jndi/ - This seems to tell the JMX client that 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 key jmxrmi

This is somewhat cart-before-horse, as one has to contact the RMI registry given by the latter part of the 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 works! The JMX RMI server port is nicely obtained from the registry. On second thoughts, the target machine should also be 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的更多相关文章

  1. VisualVM 使用 service:jmx:rmi:///...无法连接linux远程服务器

    VisualVM 无法使用 service:jmx:rmi:///jndi/rmi:///jmxrmi 连接到 关闭远程机器的防火墙即可:service iptables stop 不关闭防火墙的解决 ...

  2. 错误: JMX 连接器服务器通信错误: service:jmx:rmi://***

    电脑没有空间了,正想清理一下硬盘空间,这时不知道金山毒霸啥时候装上了,就想把它卸载了,卸载的过程中看到有空间清理,随手一点,清理出了10个G,然后再打开idea运行项目就报出这个错. 错误: JMX ...

  3. JMX RMI 攻击利用

    攻击者通过构造恶意的MBean,调用 getMBeansFromURL 从远程服务器获取 MBean,通过MLet标签提供恶意的MBean对象下载. 前提条件: 允许远程访问,没有开启认证 (com. ...

  4. 关于metaspolit中进行JAVA反序列化渗透RMI的原理分析

    一.背景: 这里需要对java反序列化有点了解,在这里得推广下自己的博客嘛,虽然写的不好,广告还是要做的.原谅我: 1.java反序列化漏洞原理研习 2.java反序列化漏洞的检测 二.攻击手法简介 ...

  5. ActiveMQ笔记(5):JMX监控

    系统上线运行后,及时监控报警是很必要的手段,对于ActiveMQ而言,主要监控的指标有:MQ本身的健康状况.每个队列的生产者数量.消费者数量.队列的当前消息数等. ActiveMQ支持JMX监控,使用 ...

  6. Java_jvisualvm使用JMX连接远程机器(实践)

    https://my.oschina.net/heroShane/blog/196227 一.启动普通的jar程序 1.执行foo.jar启动命令 java -Dcom.sun.management. ...

  7. JMX超详细解读

    一.JMX的定义 JMX(Java Management Extensions)是一个为应用程序植入管理功能的框架.JMX是一套标准的代理和服务,实际上,用户可以在任何Java应用程序中使用这些代理和 ...

  8. JMX笔记(一)

    上篇 JMX初体验 使用HtmlAdaptorServer提供的界面实现了调用MBean,除此之外,还可以使用rmi方式连接调用MBeanServer 要连接,自然要有url:service:jmx: ...

  9. Basic Example of JMX Technology--转载

    原文地址:http://nick-lab.gs.washington.edu/java/jdk1.5b/guide/jmx/tutorial/connectors.html Basic Example ...

随机推荐

  1. iphone iOS7恢复到iOS6教程

    步骤一:首先根据您iOS设备型号,下载最新的iOS 6固件,您可以进入苹果官网下载,也可以以下网址下载. http://sj.zol.com.cn/ios613/

  2. python编码格式

    python编码总结: 1).首先python有两种格式的字符串,str和unicode,其中unicode相当于字节码那样,可以跨平台使用. str转化为unicode可以通过unicode(),u ...

  3. mysql 1054错误

    往数据库插入数据的时候报错,插入数据的是这样的 [SQL] insert into stock(code,name,b_price,s_price,num,rate,profit) values (1 ...

  4. Myeclipse 2014配置SVN详细图解

    1.什么是SVN? 管理软件开发过程中的版本控制工具. 2.myeclipse安装SVN插件步骤,以myeclipse 2014为例. (1)下载SVN插件 http://subclipse.tigr ...

  5. 解决CentOS(RedHat)中sendmail和sm-client启动慢故障(转)

    Starting sendmail: Starting sm-client: 刚才发了修改主机名那篇文章后,我意外发现重新启动CentOS的时候系统会卡在sendmail和sm-client那里将近3 ...

  6. 15 Tricks to Appear Smart in Emails(转)

    英文原文:15 Tricks to Appear Smart in Emails 如果你不关心在邮件中表现聪明,就不要看本文了. 好吧,我们是孤独的. 在公司环境里,与电子通讯的肥沃土壤相比,没有什么 ...

  7. MFC窗口的父子关系和层级关系

    一直对窗口之间的关系有些混乱,遇到需要指定父窗口的函数时常常要考虑很久,究竟父窗口是哪个窗口,遂上网查资料,略有所悟,简记如下: 对话框中的所有控件(比如Button等)都是其子窗口.        ...

  8. poj 3185 The Water Bowls(反转)

    Description The cows have a line of water bowls water bowls to be right-side-up and thus use their w ...

  9. Android自己主动化測试之Monkeyrunner用法及实例

    眼下android SDK里自带的现成的測试工具有monkey 和 monkeyrunner两个.大家别看这俩兄弟名字相像,但事实上是完全然全不同的两个工具,应用在不同的測试领域.总的来说,monke ...

  10. windows平台HTTP代理server搭建(CCproxy)

    HTTP代理(CCproxy) 一.拓扑图 二.CCproxy的安装和配置 1.安装CCproxy (1)下载CCproxy无线破解版(没破解的都仅仅支持最多三个用户同一时候连接). (2)按说明安装 ...