title: JMX connection using JMXMP hangs
body: <p>I'm trying to establish a JMX connection to my tomcat instance from a java client using the below code.</p>
  
  <pre><code>JMXServiceURL url = new MXServiceURL("service:jmx:jmxmp://&lt;host&gt;:&lt;port&gt;"); //line 1
  JMXConnector jmxc = JMXConnectorFactory.connect(url);  //line 2
  MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
  </code></pre>
  
  <p>Where </p>
  
  <blockquote>
    <p>host = remote machine where my tomcat instance is running</p>
    
    <p>port = jmx enabled port.  In my code it is 9840</p>
  </blockquote>
  
  <p>My tomcat setenv.sh file is edited with below configurations to enable JMX</p>
  
  <pre><code>export CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9840 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
  </code></pre>
  
  <p>But, when i execute the program, it hangs at line 2.</p>
  
  <p>If i change line 1 as 
  <code>JMXServiceURL target = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://&lt;host&gt;:&lt;port&gt;/jmxrmi")</code> 
  to use RMI instead of JMXMP it executes and i'm able to access various MX beans.</p>
  
  <p>So, i'm not able connect if i use JMXMP protocal.  I'm able to connect if i use RMI protocol.  What might have went wrong when i use JMXMP?</p>
  
  <p>Thanks,
  nks</p>