MBeanServerConnection#queryNames() does not always correctly handle property list patterns and returns an empty set in EAP 6 and EAP 7

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x (6.2.3 onwards)
    • 7.0.x

Issue

  • MBeanServerConnection#queryNames() does not always correctly handle property list patterns and returns an empty set.

  • When I execute the following JMX Client, it returns an empty set. However, there are some MBeans which matches the pattern "jboss.as:socket-binding=*,*":

JMXServiceURL url = new JMXServiceURL("service:jmx:remoting-jmx://localhost:9999");
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
MBeanServerConnection con = jmxc.getMBeanServerConnection();

ObjectName objectName = ObjectName.getInstance("jboss.as:socket-binding=*,*");
Object result = connection.queryNames(objectName, null);
System.out.println(result);

jmxc.close();

Resolution

This is a bug reported in the following JIRA/BZ and will be fixed in the future releases:

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.