I get a ThreadMXBean proxy for remote JVM as
ObjectName objName = ManagementFactory.getThreadMXBean().getObjectName() ;
ThreadMXBean proxy = JMX.newMBeanProxy(MBeanServerConnection, objName, ThreadMXBean.class);
However, when I call the following, it says it can't convert from CompositeDataSupport to ThreadInfo.
ThreadInfo tInfo = proxy. getThreadInfo(true, true);
Shouldn't the proxy take care of all the conversion? Besides, I'm calling the getThreadInfo() on effectively ThreadMXBean.
ThreadMXBeanis an MXBean. Your code has calledJMX#newMBeanProxy. The proxy returned by this method is not capable of handling the properties of MXBeans. Instead, useJMX#newMXBeanFactoryto obtain a proxy capable of handling the properties of MXBeans.