On Jun 15, 2009, at 4:47 AM, recursion wrote:
Hi all,
In similarity with what i know from looking up the management bean
over
other application servers, over OpenEJB 3.1.1 i ran the following
code :
Properties props = new Properties();
props.put("java.naming.factory.initial",
"org.apache.openejb.client.RemoteInitialContextFactory");
props.put(Context.PROVIDER_URL,"ejbd://127.0.0.1:4201");
InitialContext ctx = new InitialContext(props);
Object ref = ctx.lookup("MEJB");
ManagementHome mHome = (ManagementHome)
PortableRemoteObject.narrow(ref,ManagementHome.class);
Management mejb = mHome.create();
StringBuilder queryBuilder = new StringBuilder(100);
queryBuilder.append("*" + ":").append("j2eeType=").append(
"J2EEApplication");
String query = queryBuilder.toString();
Set<?> result = mejb.queryNames(new ObjectName(query), null);
System.out.println(result.size());
Unfortunately, having in mind that i have deployed 2 applications (ejb
modules), i always get 0 from the snippet above! I tried with
"j2eeType=EJBModule", with the same result.
What am i doing wrong in order to query the MBean provider ?
We don't support JSR-77, though Geronimo does which uses OpenEJB.
More general JMX support with statistics is high on the todo list,
though, and is something a few of us have noted as critical. We can
definitely add something in this regard for the next release. Some
questions for you:
Do you have a specific need for the JSR-77 layout and object model?
What statistics are most important to you? Any other details on what
your needs are in relation to jmx are great.
-David