Bug 1183014

Summary: [RFE] Unable to bind to a specific JMX host
Product: Red Hat Enterprise Linux 6 Reporter: Eric Rich <erich>
Component: java-1.7.0-openjdkAssignee: Severin Gehwolf <sgehwolf>
Status: CLOSED ERRATA QA Contact: Lukáš Zachar <lzachar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5CC: ahughes, bnater, dbhole, dereed, jclere, jdoyle, jvanek, lzachar, pslavice, rsvoboda, salmy, sgehwolf
Target Milestone: rcKeywords: FutureFeature, Patch, Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: java-1.7.0-openjdk-1.7.0.95-2.6.4.4.el6 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1181318 Environment:
Last Closed: 2016-05-10 19:41:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1181318    
Bug Blocks: 1172231    
Attachments:
Description Flags
Proposed patch for jdk repository of OpenJDK 8 head
none
Proposed patch for hotspot repository of OpenJDK 8 head
none
Proposed patch for jdk repository of OpenJDK 8 head (no SslRmiServerFactory changes) none

Description Eric Rich 2015-01-16 12:32:50 UTC
+++ This bug was initially created as a clone of Bug #1181318 +++

Description of problem:

Using the following I am unable to set a JMX host. 

export CATALINA_OPTS="${CATALINA_OPTS} -Dcom.sun.management.jmxremote.host=127.0.0.1"
export CATALINA_OPTS="${CATALINA_OPTS} -Dcom.sun.management.jmxremote.port=9111"
export CATALINA_OPTS="${CATALINA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
export CATALINA_OPTS="${CATALINA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"

Version-Release number of selected component (if applicable): 2.x

How reproducible: Very

Steps to Reproduce:
1. Export varables above (note you may want to try setting JAVA_OPTS and not CATALINA_OPTS however both (in my testing) render the same results. 
2. Start Tomcat
3. netstat -tunap | grep :9111 

Actual results:

Tomcat is bound to 0.0.0.0:9111 and not 127.0.0.1:9991

Expected results:

Tomcat should be bound 127.0.0.1:9991

Additional info:

http://mail-archives.apache.org/mod_mbox/cassandra-user/201108.mbox/%3C4E40B802.2060500@wetafx.co.nz%3E

--- Additional comment from  on 2015-01-15 19:27:51 EST ---

"com.sun.management.jmxremote.host" does not exist.

The JDK does not provide a way to set the host when using com.sun.management.jmxremote properties.
It can only be done when creating the JMX connector programatically.

Also, this is a JDK configuration, not related to EWS.

Comment 18 Severin Gehwolf 2015-11-09 10:28:45 UTC
Created attachment 1091688 [details]
Proposed patch for jdk repository of OpenJDK 8 head

Comment 19 Severin Gehwolf 2015-11-09 10:29:38 UTC
Created attachment 1091689 [details]
Proposed patch for hotspot repository of OpenJDK 8 head

Comment 24 Severin Gehwolf 2015-11-12 15:46:20 UTC
Created attachment 1093369 [details]
Proposed patch for jdk repository of OpenJDK 8 head (no SslRmiServerFactory changes)

Comment 26 Severin Gehwolf 2015-12-18 09:43:20 UTC
Fix for this got pushed to upstream OpenJDK 9:
http://hg.openjdk.java.net/jdk9/hs-rt/jdk/rev/1b13503d0ef7
http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/c1a328946567

I'll ask for an 8 backport after it's been in 9 for a bit. Not sure how well an 8 backport is going to be received given the addition of a new property.

Comment 27 Andrew John Hughes 2015-12-26 21:37:50 UTC
Note that it needs to reach 7 to resolve this bug.

Comment 31 Severin Gehwolf 2016-01-29 13:28:30 UTC
Backport request for 8u-dev:
http://mail.openjdk.java.net/pipermail/jdk8u-dev/2016-January/004942.html

Comment 32 Severin Gehwolf 2016-02-15 11:02:28 UTC
(In reply to Severin Gehwolf from comment #31)
> Backport request for 8u-dev:
> http://mail.openjdk.java.net/pipermail/jdk8u-dev/2016-January/004942.html

Fixes have been pushed to 8u upstream today:

Main patch: https://bugs.openjdk.java.net/browse/JDK-8148845
Test fix 1: https://bugs.openjdk.java.net/browse/JDK-8149808
Test fix 2: https://bugs.openjdk.java.net/browse/JDK-8149809

I'll look into JDK 7 backports this week.

Comment 33 Severin Gehwolf 2016-02-19 14:34:32 UTC
Backport request for 7u-dev:
http://mail.openjdk.java.net/pipermail/jdk7u-dev/2016-February/010474.html

Comment 44 errata-xmlrpc 2016-05-10 19:41:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0752.html