I am able to access Gridgain beans from jconsole, but when I try accessing Gridgain beans ones inside the grid like GridKernalMBean using JMX programmatically, I get "javax.management.NotCompliantMBeanException"
Here is code I am using :
String jmxUrl = "service:jmx:rmi:///jndi/rmi://" + HOST+ ":" + PORT + "/jmxrmi";
JMXServiceURL url = new JMXServiceURL(jmxUrl);
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
ObjectName objectName = new ObjectName("org.gridgain:grid=gridname,group=Kernal,name=GridKernal");
org.gridgain.grid.GridKernalMBean mbean = JMX.newMXBeanProxy(mbsc, objectName, org.gridgain.grid.GridKernalMBean.class);
Beans outside grid works fine :-
String jmxUrl = "service:jmx:rmi:///jndi/rmi://" + HOST+ ":" + PORT + "/jmxrmi";
JMXServiceURL url = new JMXServiceURL(jmxUrl);
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
ObjectName objectName = new ObjectName("org.gridgain:group=Kernal,name=GridGain");
org.gridgain.grid.GridGainMBean mbean = JMX.newMXBeanProxy(mbsc, objectName, org.gridgain.grid.GridGainMBean.class);
Am I missing any configurations in gridgain config file ?
It means that your target mbeans are not MXBeans and are exposing non standard data types. Try using javax.management.MBeanServerInvocationHandler to create a proxy. It's a bit more liberal, but keep in mind that those non standard type attributes will not appear in your client unless they are serializable and in your client classpath.