如何使用远程进程通过jconsole连接到本地应用程序?

问题描述 投票:0回答:2

我有普通的Spring启动应用程序,当我从Local Processes组中选择它时,能够使用jconsole连接到该应用程序:

enter image description here

但我想远程连接到我的应用程序。首先,我想从同一台PC连接,但使用远程进程。

我尝试输入localhost:1099和localhost:1199但它没有连接:

enter image description here

我没有传递任何特殊的VM密钥。

如何使用远程进程连接?

java spring-boot jmx jconsole spring-jmx
2个回答
0
投票

当我使用-Dcom.sun.management.jmxremote.port的端口时,我能够连接


0
投票

必须使用以下java运行时参数启动受监视的应用程序:

-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.port=1199
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

然后在JConsole中,您可以使用localhost:1199连接到远程进程。

© www.soinside.com 2019 - 2024. All rights reserved.