Jconsole cannot connect
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.
Adding below property as VM argument in Run Configurations --> Arguments --
-Dcom.sun.management.jmxremote=true
In my case, I also had to add this option to get Jconsole to connect to the process.
-Djava.rmi.server.hostname=localhost
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.