-
1. Re: All MBeans go missing ?
adrian.brock Jun 2, 2003 5:02 AM (in response to bgw2)Do you have something that creates an MBeanServer?
The jmx-console isn't very clever about which
one it chooses.
Regards,
Adrian -
2. Re: All MBeans go missing ?
bgw2 Jun 6, 2003 3:24 PM (in response to bgw2)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,
Bruce