0 Replies Latest reply on Nov 17, 2006 9:57 PM by Brian Stansberry

    JMX Queries and beans registered via @JMX annotation

    Brian Stansberry Master

      Just wanted to mention something I ran across so others are aware of it.

      If you deploy a bean via -beans.xml (say for example an instance of ClusterPartition) and register it in JMX using the @JMX annotation, queries like this won't work any more:

       MBeanServer server = MBeanServerLocator.locate();
       QueryExp exp = Query.and(
       Query.eq(
       Query.classattr(),
       Query.value(ClusterPartition.class.getName ())
       ),
       Query.match(
       Query.attr("PartitionName"),
       Query.value(name)
       )
       );
      
       Set mbeans = server.queryMBeans (null, exp);


      Problem is the restriction using the ClusterPartition class -- the object registered in JMX is an instance of AopContainerProxy, not ClusterPartition.

      I found workarounds for this exact issue; this post is just an FYI for others.