Hi,
I'm trying use method.invoke(..) on the MXBeans but I'm getting
IllegalAccessException on some but not all the MXBeans. Anybody know
why? And how to get around this problem?
java.lang.management.ClassLoadingMXBean clBean =
ManagementFactory.getClassLoadingMXBean();
java.lang.reflect.Method method =
clBean.getClass().getMethod("getLoadedClassCount", (Class[]) null);
method.invoke(clBean, (Object[]) null);
These get IllegalAccessException:
ClassLoadingMXBean
CompilationMXBean
GarbageCollectorMXBean
MemoryMXBean
MemoryMXBean
These allow me to use method.invoke():
OperatingSystemMXBean
MemoryUsage
Jennifer