The JTop plugin includes this code:
public void setMBeanServerConnection(MBeanServerConnection mbs) {
this.server = mbs;
try {
this.tmbean = newPlatformMXBeanProxy(server,
THREAD_MXBEAN_NAME,
ThreadMXBean.class);
} catch (IOException e) {
e.printStackTrace();
}
if (!tmbean.isThreadCpuTimeSupported()) {
System.err.println("This VM does not support thread CPU time monitor
ing");
} else {
tmbean.setThreadCpuTimeEnabled(true);
}
}
Notice the line tmbean This triggers bug 6696970 which causes JConsole to become unusable for the connection as a whole. If 6696970 is fixed then it might be reasonable to throw an exception (which JConsole will presumably display in a dialog window), but it would be better for JTop to catch the exception and operate in a degraded mode where it doesn't show CPU times (but does still show the list of threads).
public void setMBeanServerConnection(MBeanServerConnection mbs) {
this.server = mbs;
try {
this.tmbean = newPlatformMXBeanProxy(server,
THREAD_MXBEAN_NAME,
ThreadMXBean.class);
} catch (IOException e) {
e.printStackTrace();
}
if (!tmbean.isThreadCpuTimeSupported()) {
System.err.println("This VM does not support thread CPU time monitor
ing");
} else {
tmbean.setThreadCpuTimeEnabled(true);
}
}
Notice the line tmbean This triggers bug 6696970 which causes JConsole to become unusable for the connection as a whole. If 6696970 is fixed then it might be reasonable to throw an exception (which JConsole will presumably display in a dialog window), but it would be better for JTop to catch the exception and operate in a degraded mode where it doesn't show CPU times (but does still show the list of threads).
- relates to
-
JDK-6696970 Jconsole becomes unusable if a plugin throws an exception
-
- Resolved
-