[英]Java Mission Control – Flight Recorder throws parser exception
[英]Java Mission Control: Flight Recorder throws: javax.naming.ServiceUnavailableException
我正在尝试使用Oracle Java Mission控件分析Java Spring应用程序。 我将JVM连接配置为: localhost:7091
并使用java -Dcom.sun.management.jmxremote.rmi.port=7091 -jar app.jar
启动了应用程序。
当我尝试启动飞行记录器时,我收到一条错误消息。
Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect]
Could not connect to a JVM at service:jmx:rmi:///jndi/rmi://localhost:7091/jmxrmi. Make sure one is running and that you are using the correct protocol in the Service URL.
有谁知道该错误的原因是什么?
您可以尝试使用自动发现。 然后,连接将自动显示在JMC中
-Dcom.sun.management.jmxremote.autodiscovery =真
您也可以命名连接,以便轻松识别。
-Dcom.sun.management.jdp.name =应用
并禁用安全性
-Dcom.sun.management.jmxremote.authenticate = FALSE
-Dcom.sun.management.jmxremote.ssl = FALSE
我有这个问题。 我已在Windows Server 2016上安装了JDK10。我希望使用JMC和JVM在同一服务器上进行监视。
上线时,我们将IP从临时IP切换到了实时IP。 但是,JMC将localhost
解析为原始IP。 同样,在指定服务器的当前IP时,JMC会将其解析为原始IP。
将-Djava.rmi.server.hostname=localhost
添加到我要监视的Java进程中,解决了该问题。
但是,我仍然想知道为什么JMC(或RMI)仍然无法正确解析。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.