2

This question has been answered multiple times in Stackoverflow. However, I observe something, that is weird to me. As the title says, I'm unable to connect to a remote Java application from Java VisualVM from my laptop using JMX.

JVM Arguments used:

 -Dcom.sun.management.jmxremote 
 -Dcom.sun.management.jmxremote.port=9701
 -Dcom.sun.management.jmxremote.local.only=false 
 -Dcom.sun.management.jmxremote.authenticate=false 
 -Dcom.sun.management.jmxremote.ssl=false 
 -Djava.rmi.server.hostname=170.76.90.68

Argument provided in "Add JMX Connection" dialogue box":

 service:jmx:rmi:///jndi/rmi://170.76.90.68:9701/jmxrmi

I do see an 'established' connection in the remote server. That proves there is no firewall issue.

[09:45:59] dev@mx501:[/home/dex/bin]$ netstat -nap | grep :9701
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:9701                0.0.0.0:*                     LISTEN      -
tcp        0      0 170.76.90.68:9701           10.119.136.76:59186         ESTABLISHED -

However, that 'established' connection goes away after some time and I get a typical exception in Java VisualVM, saying the connection could not be established.

[09:56:39] dev@mx501:[/home/dex/bin]$ netstat -nap | grep :9701
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:9701                0.0.0.0:*                   LISTEN      -
[09:56:54] dev@mx501:[/home/dex/bin]$

Please help.

3
  • Are you able to connect using Jconsole ? Commented Jan 30, 2019 at 6:05
  • I tried using JConsole. It exhibits same behaviour. I observed an incoming connection from my laptop in the remote server. After some time, it goes away and I get a pop up in JConsole saying the connection did not succeed. Commented Jan 30, 2019 at 8:44
  • can you try the link to debug why the JConsole connection is failed? stackoverflow.com/questions/5455831/… Commented Jan 30, 2019 at 9:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.