We are migrating an application from JBoss 4.2.1 GA to JBos EAP 7.0.0. The application audits currentThreadsBusy that is thread count. This does not work on EAP.
Below is the code snippent
javax.management.MBeanServerConnection server = java.lang.management.ManagementFactory.getPlatformMBeanServer();
javax.management.QueryExp qe = javax.management.Query.finalSubString(javax.management.Query.attr("name"), javax.management.Query.value("-" + request.getLocalPort()));
System.out.println("qu = "+qe.toString());
Set<ObjectInstance> set = server.queryMBeans(new javax.management.ObjectName("jboss.web:type=ThreadPool,*"),qe);
System.out.println("Set = "+set);
String objectName = "";
for (ObjectInstance objectInstance : set) {
if (objectInstance.getObjectName().getCanonicalName().contains("=http")) {
objectName = objectInstance.getObjectName().getCanonicalName();
}
}
System.out.println("objectName = "+objectName);
Object object = server.getAttribute(new ObjectName(objectName),"currentThreadsBusy");
System.out.println("object "+object);
The issue is the Set returned is NULL.
The issue could be we need to enable web thread monitoring on EAP 7 before we can query the mbean service.
In the jConsole too we cannot see the web thread component.
Any pointer or help is appreciated here.