title: MBean "jboss.web:type=Manager,path=/,host=localhost" not found
body: <p>I'm trying to access the <strong>JBoss v4.2</strong> MBean registered as</p>
  
  <pre><code>jboss.web:type=Manager,path=/,host=localhost
  </code></pre>
  
  <p>using the following code:</p>
  
  <pre><code>ObjectName name = new ObjectName("jboss.web:type=Manager,path=/,host=localhost");
  ManagementFactory.getPlatformMBeanServer().getAttribute(name, "activeSessions");
  </code></pre>
  
  <p>But this code keeps throwing the following exception:</p>
  
  <pre><code>javax.management.InstanceNotFoundException : jboss.web:type=Manager,path=/,host=localhost is not registered.
  </code></pre>
  
  <p>On the other hand I'm able to see and use this bean using the jmx-console via ...//localhost:8080/jmx-console/ - the MBean is available.</p>
  
  <p><img src="https://i.stack.imgur.com/thC1R.png" alt="Screenshot"></p>
  
  <p><strong><em>What else is necessary to access the same MBean via code?</em></strong></p>