1 Reply Latest reply on Jul 28, 2006 11:09 AM by martinator

    Unable to Obtain JMX MBean for Servlet Info

    martinator

      Hi, I'm trying to pull servlet statistics from JMX. The process works great for ServerInfo as follows:

      MBeanServer lBeanServer = org.jboss.mx.util.MBeanServerLocator.locateJBoss();
      ObjectName lBeanName = new ObjectName("jboss.system:type=ServerInfo");
      Object lAttribute = lBeanServer.getAttribute(lBeanName, "FreeMemory");


      It will not work for getting servlet statistics:

      MBeanServer lBeanServer = org.jboss.mx.util.MBeanServerLocator.locateJBoss();
      ObjectName lBeanName = new ObjectName("jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/xxxxxx,j2eeType=Servlet,name=default");
      Object lAttribute = lBeanServer.getAttribute(lBeanName, "requestCount");


      I reproduced the string exactly as it appears in the JBoss Console. When I run it it tells me that "default is not registered."

      I'm running JBoss 3.2.4 and Java 1.4.2_03.

      Can anyone help?