Saturday, August 25, 2012

WebLogic, detecting stuck threads with JMX and Java

Surprisingly, the "Health" reported in the Servers monitoring tab

is NOT the ServerRuntime.HealthState, but rather the


the parent of this MBean is com.bea:Name=osbpl1ms1,Type=ServerRuntime, its type and name are ThreadPoolRuntime

which also contains a

For this reason, to the code of the previous post I have added a new method:

    public static String getThisServerThreadPoolHealth() throws Exception {
 MBeanServerConnection connection = initConnection();
 ObjectName runtimeService = new ObjectName("com.bea:Name=RuntimeService,");
 String managedServerName = (String) connection.getAttribute(runtimeService, "ServerName");
 ObjectName serverRT = new ObjectName("com.bea:Name=" + managedServerName + ",Type=ServerRuntime");
 System.out.println("serverRT=" + serverRT);
 ObjectName serverTP = (ObjectName)connection.getAttribute(serverRT, "ThreadPoolRuntime"); tpHealthState = ( connection.getAttribute(serverTP, "HealthState");
 return healthStateToString(tpHealthState.getState());

No comments: