Jconsole cannot connect
Asked Answered
L

5

17

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.

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?

Largent answered 17/8, 2013 at 23:5 Comment(2)
There's nothing you need to do that would be different from doing it sitting at the physical keyboard. Does the ts_watchdog program disallow VM management?Esdras
No I run the same program from the same Executable Jar as a service using nohup java -jar [path] & ; Then I run jconosle PID and I am connected. If it makes a difference my laptop is a mac and the server is ubuntu.Largent
L
24

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

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

-- Edit - Fixed the =fals error mentioned in comments.

Largent answered 21/8, 2013 at 2:12 Comment(1)
At the end of the line it is not fals, but false. But it is ok! Thank you!Hesiod
W
18

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

-Djava.rmi.server.hostname=localhost

Wyndham answered 23/5, 2019 at 21:29 Comment(2)
this also required in MAC I guess.Fillet
yup, this fixed the issue for me and I'm running jconsole from a mac terminal.Alfons
S
5

Remote JConsole

Add the following parameters to your java Application and run it

-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

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.

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

Substitution answered 17/7, 2019 at 7:4 Comment(0)
A
2

In my case, I had to make it false and also add a hostname to localhost. Add this in VM arguments in Run Configurations.

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=localhost

enter image description here

Amaras answered 2/7, 2021 at 3:50 Comment(0)
A
1

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

-Dcom.sun.management.jmxremote=true
Accuracy answered 24/4, 2015 at 7:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.