2 Replies Latest reply on Jun 6, 2003 3:24 PM by Bruce Wilson

    All MBeans go missing ?

    Bruce Wilson Newbie

      I'm running JBoss 3.0.7 on JDK 1.4.1. I'm finding that all MBeans seem to disappear (are no longer registered) after my server runs for a while. Only the 3 MBeans under
      the "JMImplementation" domain (LoaderRepository,
      MBeanRegistrty, and MBeanServerDelegate) are listed
      in jmx-console. MBeanRegistry does indeed say that 3
      MBeans are registered. Has anyone experienced a
      similar problem ? Can't imagine what could be causing this. Rebooting the server shows that all the MBeans are
      there again (1124 MBeans total).

        • 1. Re: All MBeans go missing ?
          Adrian Brock Master

          Do you have something that creates an MBeanServer?
          The jmx-console isn't very clever about which
          one it chooses.


          • 2. Re: All MBeans go missing ?
            Bruce Wilson Newbie

            Thanks very much for the pointer, Adrian ! That's what it was - someone was creating some new MBeanServers (don't ask why, it's too painful to relate !).

            Wrote this snippet of code in a JSP and ran it:

            <%@ page import="java.util.*" %>
            <%@ page import="javax.management.*" %>
            ArrayList servers = MBeanServerFactory.findMBeanServer( null );
            Iterator iter = servers.iterator();

            out.println( "Number of servers=" + servers.size() + "" );

            while( iter.hasNext() ) {
            MBeanServer server = (MBeanServer)iter.next();
            String domain = server.getDefaultDomain();
            Integer count = server.getMBeanCount();
            out.println( server.toString() + ": domain=" + domain +
            ", count=" + count + "" );

            ...and got back this for a list:

            Number of servers=51 <<-- Yow !!!
            org.jboss.mx.server.MBeanServerImpl@1c6d39e: domain=DefaultDomain, count=3
            org.jboss.mx.server.MBeanServerImpl@6f47b4: domain=DefaultDomain, count=3

            org.jboss.mx.server.MBeanServerImpl@bb7465: domain=jboss, count=1825
            org.jboss.mx.server.MBeanServerImpl@1f20579: domain=DefaultDomain, count=3
            org.jboss.mx.server.MBeanServerImpl@457d2b: domain=DefaultDomain, count=3
            org.jboss.mx.server.MBeanServerImpl@1cbf53: domain=DefaultDomain, count=3

            There's some code in the jmx-console that finds the list of all MBeanServers and takes the first one on the list; don't know why, but the "jboss" domain MBeanServer didn't end up being first (would have thought that it started earlier in the cycle than the offending code that created the additional MBeanServers).

            Oh, well, problem solved !

            Thanks again for your help,