title: Tomcat7 with enabled JMX opens 2 additional random listening ports
body: <p>I run Tomcat7 using JDK7 on Centos6.
  I enable JMX using the following options:</p>
  
  <pre><code>CATALINA_OPTS="${CATALINA_OPTS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9123 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=true"
  </code></pre>
  
  <p>Unfortunately, when I check what ports are opened I discover 2 additional random ports:</p>
  
  <pre><code>netstat -plunt | grep java
  Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
  tcp        0      0 :::60555                            :::*                LISTEN      22752/java
  tcp        0      0 ::ffff:127.0.0.1:8080               :::*                LISTEN      22752/java
  tcp        0      0 :::9123                             :::*                LISTEN      22752/java
  tcp        0      0 :::40867                            :::*                LISTEN      22752/java
  </code></pre>
  
  <p>I guess that JMX should open one additional port <a href="https://stackoverflow.com/questions/7163173/jmx-enabled-java-application-appears-to-open-a-random-high-order-port-when-jmx-c">JMX enabled Java application appears to open a random high order port when JMX client connects</a></p>
  
  <p>Why JMX in Tomcat opens 2 additional ports?</p>
  
  <p>How can I configure these ports?</p>
  
  <p>If I configure <code>-Dcom.sun.management.jmxremote.local.only=true</code> means additional ports also can be accessed using local access only?</p>
  
  <p>How can I configure <code>::ffff:127.0.0.1</code> will appear before all ports opened by JMX? </p>