Feb 6th, 2007, 07:28 AM
We are trying to use MBeanServerConnectionFactoryBean in our application to make a JMX call to validate connectivity. If the server he is connected to goes down, we do not see anyway to force the bean to reconnect. Are we missing something?
Mar 8th, 2007, 11:20 AM
I am having the same issue have you found anything about reconnecting?
Any help appreciated.
Mar 9th, 2007, 03:28 AM
Some Sample Code
<bean id="jmxConnection" class="org.springframework.jmx.support.MBeanServer ConnectionFactoryBean">
<property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://localhost:10123/jmxrmi" />
<bean id="smppJmxController" class="org.springframework.jmx.access.MBeanProxyFa ctoryBean">
<property name="objectName" value="com.myname:name=MyClassJmxController"/>
<property name="proxyInterface" value="MYCLASSNAME"/>
<property name="server"><ref bean="jmxConnection"/></property>
Now I can connect to the MYCLASSNAME however if for any reason the jmx server goes down and is then restarted or available again I cannot connect to it. It is a MVC webapp by the way the following is the error i get on the controller trying to use the mbean
org.springframework.jmx.access.InvocationFailureEx ception: JMX access failed; nested exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused
I want ot be able to somehoe have the server reconnect so that my calls will be successful am I doing this totally wrong?
Any pointers appreciated.
Mar 12th, 2007, 12:00 PM
I am now trying to reconect by call refresh in the webapplicationContext but I get the following message.
[org.springframework.beans.factory.support.Disposab leBeanAdapter] - Couldn't invoke destroy method of bean with name 'jmxConnection'
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
Needless to say I am not getting anywhere fast with this issue please help
Mar 13th, 2007, 03:59 AM
We subclassed the Spring class and put the reconnect in ourselves.
Mar 14th, 2007, 04:53 AM
May 3rd, 2007, 01:56 PM
Would you be willing to share? This would be a fantastically useful feature for me.
Originally Posted by davidr
May 6th, 2007, 02:01 AM
We did it but without spring
Jun 6th, 2007, 12:40 PM
Could someone tell me if this code really works? Seems like some nub (like me) first shot.
Jun 6th, 2007, 01:06 PM
I didn't use it. Instead, I rely on Spring to handle the server-based JMX connector, but use a custom, non-Spring client that connects for each method invocation.