I am trying to get the status of the deployed WebApplications on JBoss through JMX.
I wrote a groovy code, but I am not seeing any JBoss MBean in my output.
Just for testing I tried to print all MBeans where I defined the query as "*:*", and I was able to see 102 in total but non of them are from JBoss. Not sure if I am doing something wrong in my code.
import javax.management.remote.JMXConnectorFactory as JmxFactory
import javax.management.remote.JMXServiceURL as JmxUrl
def sb =''<<'';
def server = JmxFactory.connect(new JmxUrl(serverUrl)).MBeanServerConnection
//query = "jboss.j2ee:*";
query = "*:*";
matches = server.queryNames( new ObjectName( query ), null );
for (i in matches)
println("Total Mbeans= "+matches.size());
Thank you for your help.
Retrieving data ...