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.

de_xtr
  • 882
  • 2
  • 10
  • 21
  • Are you able to connect using Jconsole ? – Ramesh Subramanian Jan 30 '19 at 06: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. – de_xtr Jan 30 '19 at 08:44
  • can you try the link to debug why the JConsole connection is failed? https://stackoverflow.com/questions/5455831/debugging-jconsole-connection-failed – Ramesh Subramanian Jan 30 '19 at 09:07

0 Answers0