Creating a proxy to a java.lang.management.MemoryMXBean
Hello all,
I attempting to create a proxy to a MemoryMXBean. The interface is: java.lang.management.MemoryMXBean and the object name is: java.lang:type=Memory. This is per the javadocs: http://java.sun.com/j2se/1.5.0/docs/...oryMXBean.html
My spring config is as follows:
<beans>
<bean id="memProxy" class="org.springframework.jmx.access.MBeanProxyFa ctoryBean">
<property name="objectName" value="java.lang:type=Memory"/>
<property name="proxyInterface" value="java.lang.management.MemoryMXBean"/>
</bean>
</beans>
The java code that is attempting to use the proxy is the following:
ApplicationContext context = new ClassPathXmlApplicationContext("..\\jmxTest.xml");
MemoryMXBean memoryMXBean = (MemoryMXBean) context.getBean("memProxy");
memoryMXBean.gc();
long heapMemoryUsed = memoryMXBean.getHeapMemoryUsage().getUsed();
The application context is being created, the MemoryMXBean is being set, and the gc method of memoryMXBean is being called correctly, however, after the call to memoryMXBean.getHeapMemoryUsage().getUsed(); is being performed the following exception.getMessage is being shown: "javax.management.openmbean.CompositeDataSuppo rt" and the following exception.getStackTrace is being shown: "[Ljava.lang.StackTraceElement;@787c16"
Any ideas as to why this might be? Any comments would be greatly appreciated.
Thanks.