JDK-6440708 : JMX remote for monitoring the JVM doesn't support binding to an interface
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 5.0,6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_10,windows_2000
  • CPU: x86,sparc
  • Submitted: 2006-06-20
  • Updated: 2017-01-23
  • Resolved: 2017-01-23
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
The jmx remote connection to the monitoring system of the JVM only allows to specify the port and not the interface on which it's listening.

JUSTIFICATION :
When running cluster software binding instances to a specific (virtual) interface is necessary.

If the ports cannot be bound to a specific interface this will prevent smooth failover in the cluster.

Also the SNMP-functionality of monitoring supports bidning to an interface.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Setting a property, for example called "com.sun.management.jmxremote. interface=localhost"  would bind the JMX remote to only bind to the loopback interface.

CUSTOMER SUBMITTED WORKAROUND :
Twiddling around with the DNS so that the default algorithm selects the desired interface, this is however very cumbersome and quite often not practially possible.

Comments
This looks like a duplicate of JDK-6425769. After JDK-6425769 property com.sun.management.jmxremote.host can be used to bind to a specific interface.
11-02-2016

WORK AROUND Two possible workarounds here: 1/ Bind the remote object to all the network interfaces and use the "java.rmi.server.hostname" system property when running your application to specify the interface in the stub. 2/ This is not configurable through the out-of-the-box management agent properties file but you can mimick the out-of-the-box management agent as explained in http://blogs.sun.com/roller/page/lmalventosa?entry=mimicking_the_out_of_the and supply your own RMI [client|server] socket factories to bind to a given interface. You would still need to use the "java.rmi.server.hostname" system property to specify the interface in the stub or you could discard the stub's interface and provide a way for the RMI client socket factory to find out the interface to use when creating the client sockets.
20-06-2006

EVALUATION This would require defining new specific RMI [client|server] socket factories where the binding interface could be specified and probably tell the user to specify the "java.rmi.server.hostname" when running the application or define a way for the RMI client socket factory to find out the interface to use when creating the client sockets.
20-06-2006