Title: Message
I just tried that and it didn't work.
 
When you say "the standard mbean naming convention", to what are you referring?  The JBoss deployment files all use lowercase for MBean ObjectName property names.  The examples in Juha and Mark's JMX book also use lowercase.  Are you saying that JBoss's JMX implementation uppercases the first letter of ObjectName property names somewhere along the line?
-----Original Message-----
From: Scott M Stark [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 8:54 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] MBeanServer.queryNames() not working

The "name" attribute should be "Name" to match the standard mbean naming convention.
 
xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx
----- Original Message -----
Sent: Tuesday, June 10, 2003 7:01 AM
Subject: [JBoss-user] MBeanServer.queryNames() not working

If it's user error, I hope someone can point it out to me.  I'm using version 3.0.6.  I have one MBean that is attempting to use MBeanServer.queryNames() to look up other MBeans.  However, queryNames() is returning an empty Set.

Here's the code:
                        QueryExp nameExp =
                                Query.match(Query.attr("name"), Query.value("XTFResource"));
                        QueryExp exp = nameExp;
                        ObjectName scope = new ObjectName("tsh:*");
                        logger.debug("Query _expression_="+ exp);
                        logger.debug("Scope="+ scope);

                        ArrayList mbeanServers = MBeanServerFactory.findMBeanServer(null);
                        Iterator iter = mbeanServers.iterator();
                        while (iter.hasNext()) {
                                MBeanServer mbeanServer = (MBeanServer) iter.next();
                                Set names = mbeanServer.queryNames(scope, exp);
                                logger.debug("Found XTFResources: " + names);

The logging output is:
Query _expression_=(name matches XTFResource)
Scope=tsh:*

When I ran the method, the following MBean was registered, but queryNames did not return it.
Domain Name: tsh name: XTFResource


Reply via email to