JDK-6209663 : jconsole won't connect to remote JVM on Linux
  • Type: Bug
  • Component: tools
  • Sub-Component: jconsole
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: linux
  • CPU: x86
  • Submitted: 2004-12-16
  • Updated: 2010-04-02
  • Resolved: 2005-03-02
Description
FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)

JDK 1.5.0
JDK 1.6.0-EA

ADDITIONAL OS VERSION INFORMATION :
Fedora Core 3 2.6.9-667
Debian testing 2.6.8-1
Debian unstable 2.6.9-1
SUSE ENTERPRISE LINUX 9
Windows XP SP 1


A DESCRIPTION OF THE PROBLEM :
jconsole won't connect to a remote Linux JVM - "connection failed".  Tested on different Linux distributions and versions, and on different JVMs.

I can connect just fine locally on all Linux platforms, using either Local or Remote tab in jconsole.

I can also connect remotely from Linux to JVM on Windows XP, using the same command line and SampleTest.

Connecting from Linux to Linux or from Windows to Linux does NOT work, however.

I'm not running firewalls or filters on any of these systems.  Network is working, cause I'm using ssh/scp/ftp to login and copy files etc.  ping between these systems work.  I can also connect using telnet remote-ip 8999 from the jconsole box to the remote JVM and see that it actually responds (pressing Enter three times closes the connection).

I'm having the same problem for authenticated (still no ssl) connection.  This also means that authenticated works *locally*, just not remotely.

On the "server" side, I'm using the JMX SampleTest program.

(Haven't found anything in the installation notes or release notes indicating this should not work on Linux.  Also, haven't found anything in Bug Parade, on java.net/java.sun.com forums or Google.)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
On the "server" side:
java -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false SampleTest

(used -Dcom.sun.management.jmxremote only to test Local-only connection.)

On the client side:
jconsole remote-ip:8999



EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Connect!
ACTUAL -
jconsole reports "Connection failed".

ERROR MESSAGES/STACK TRACES THAT OCCUR :
jconsole reports "Connection failed".

REPRODUCIBILITY :
This bug can be reproduced often.
###@###.### 2004-12-16 19:25:03 GMT

Comments
EVALUATION I'm able to connect from Windows to Linux and also from Linux to Linux. The application is running on RedHat A.S. 2.1. JDK 5.0 jconsole running on Windows 2000 and RedHat Enterprise Linux 3.0 Update 1 both work! I suspect this is related to the hostname resolution. Suggest the submitter to try entering IP address instead of hostname to verify if it works or not. ###@###.### 2004-12-16 20:01:44 GMT Some Linux distributions setup /etc/hosts so that the hostname resolves to the loopback address rather than the host address. If you use "hostname -i" and it reports 127.0.0.1 then you may have problems with RMI and jconsole. Editing /etc/hosts so that the hostname resolves to the host address will fix the issue. ###@###.### 2005-2-03 17:20:00 GMT The submitter has verified that it's a Linux /etc/hosts problem as described above in the evalution. This will be closed as "not a defect". We will document this problem in the JConsole FAQ in the next documentation update under: http://java.sun.com/j2se/1.5.0/docs/guide/management/jconsole.html ###@###.### 2005-03-02 19:03:00 GMT
16-12-2004