Java Jconsole 无法连接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18294130/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 00:10:39  来源:igfitidea点击:

Jconsole cannot connect

javalinuxvncjconsole

提问by Arnab C.

I am using VNC to connect to a server. I am able to VNC into the server, and open Jconsole, but cannot get it to connect to my process whether I include the PID or try connecting using the GUI. The weird thing is all the processes show up in the GUI. See below.

我正在使用 VNC 连接到服务器。我能够将 VNC 连接到服务器,并打开 Jconsole,但是无论我包含 PID 还是尝试使用 GUI 连接,都无法让它连接到我的进程。奇怪的是所有进程都显示在 GUI 中。见下文。

enter image description here

在此处输入图片说明

I get this when I try connecting:

当我尝试连接时,我得到了这个:

enter image description here

在此处输入图片说明

Followed by

其次是

enter image description here

在此处输入图片说明

Is there something I need to do in order to get Jconsole working locally on a Linux server over VNC?

为了让 Jconsole 通过 VNC 在 Linux 服务器上本地工作,我需要做些什么吗?

采纳答案by Arnab C.

Fix found here: You need to pass to the VM:

修复在这里找到:您需要传递给VM:

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false

-- Edit - Fixed the =falserror mentioned in comments.

-- 编辑 - 修正了=fals评论中提到的错误。

回答by Suvasis

Adding below property as VM argument in Run Configurations --> Arguments --

在 Run Configurations --> Arguments -- 中添加以下属性作为 VM 参数

-Dcom.sun.management.jmxremote=true

回答by Dexter

In my case, I also had to add this option to get Jconsole to connect to the process.

就我而言,我还必须添加此选项才能让 Jconsole 连接到进程。

-Djava.rmi.server.hostname=localhost

-Djava.rmi.server.hostname=localhost

回答by Abdul Hakeem

Remote JConsole

远程 JConsole

Add the following parameters to your java Application and run it

将以下参数添加到您的 java 应用程序并运行它

-Djava.rmi.server.hostname=DOMAIN_PUBLIC_URL  -Dcom.sun.management.jmxremote.port=PORTNUMBER -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false

DOMAIN_PUBLIC_URL- Like your instance public address

DOMAIN_PUBLIC_URL- 喜欢你的实例公共地址

PORTNUMBER- 9955

PORTNUMBER- 9955

Launch jconsole in your ubuntu from terminal command and go to remote connection and paste the DOMAIN_PUBLIC_URL and PORT and Connect it without username and password like insecure connection.

从终端命令在您的 ubuntu 中启动 jconsole 并转到远程连接并粘贴 DOMAIN_PUBLIC_URL 和 PORT 并在没有用户名和密码的情况下连接它,如不安全的连接。

Make sure to expose the port number on your AWS Server Instance.

确保在您的 AWS 服务器实例上公开端口号。