A little assistance with defining a remote client proxy would be appreciated. if there is a small but complete example app using mbeanserverconnectionfactorybean, and proxying JMX MBeans would be very helpful.

This is what I have so far:

in my applicationContext.xml i have the following defined.

<beans>
<bean id="clientConnector" class="org.springframework.jmx.support.MBeanServer ConnectionFactoryBean">
<Property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://localhost:9080/jmxrmi"/>
</bean>

<bean id="runtime" class="org.springframework.jmx.access.MBeanProxyFa ctoryBean">
<property name="objectName" value="java.lang:type=Runtime"/>
<property name=roxyInterface" value="springJMX.RunTimeInfo"/>
</bean>
</beans>

THere is an RunTimeInfo Java interface that has 4 getters including getVmInfo as an example.

There is a main Java class that successully establishes an MBeanServerConnection instance called clientConnector which succesfully retrieves the domains from Tomcat, so I know that part is correct.

I do not refererence in the main app the RunTimeInfo interface.

The error I am getting when I run the app is: Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'runtime' defined in class path resource [applicationContext.xml]: Initialization of bean failed;nested exception is org.springframewor.jmx.MBeanServerNotFoundExceptio n: Unable to locate MBeanServer instance.

I am not sure what is missing since I know I received my remote MBean Server instance from Spring. My Main app contains the following:

MBeanServerConnection clientConnnector = (MBeanServerConnection) ctx.getBean("clientConnector");


Any suggestions or a Java code and xml example of proxying remote JMX beans would be great. Thank you.

- Andy