[jboss-user] [Management, JMX/JBoss] - Re: jboss monitoring

priyapg do-not-reply at jboss.com
Wed Jan 14 23:03:54 EST 2009


Here is my code to extract info from mbean ,but the set size returns zero.So  not getting info on mbeans.Can u plz help me on this?
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://10.200.9.148:9900/jmxrmi");
                        JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
                        MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
                  
                      ObjectName pattern=new ObjectName("jboss.jmx:*");
                      Set res = mbsc.queryNames(pattern,null);
                      System.out.println("set size="+res.size());
                      for (Iterator i = res.iterator(); i.hasNext(); ) {
                      ObjectName o = (ObjectName)i.next();
                      System.out.println("MBean:  " + o);
                      MBeanAttributeInfo[] info = mbsc.getMBeanInfo(o).getAttributes();
                      for (int j=0 ; j< info.length; j++)  {
                                    MBeanAttributeInfo beanInfo = info[j];
                                    final String attrname = beanInfo.getName();                                  
                                    System.out.println("\t"+attrname+"="+mbsc.getAttribute(o,attrname));                      
                          
                      }
    }	

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4202001#4202001

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4202001



More information about the jboss-user mailing list