Announcement Announcement Module
No announcement yet.
tomcat restart issue with jmx Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • tomcat restart issue with jmx


    I have two applications communicating each other using jmx. For example

    application 1 ==> Source application
    application 2 ==> deployed under tomcat that communicates to "application 1" using jmx as follows
    <bean id="clientConnector" class=" ConnectionFactoryBean>
    <property name="serviceUrl"
    <property name="environment">
    <prop key="jmx.remote.jndi.rebind">true</prop>

    Whenever application 1 is restarted (without being tomcat(application 2) restarted) the connection becomes stale in application 2. Is there any way to get around this. For RmiProxyFactoryBean we have some thing like refreshStubonConnectFailure. Is there any similar thing for jmx..

    Thanks for your help!!!

  • #2
    The closest analogy to RmiProxyFactoryBean in JMX is the MBeanProxyFactoryBean (which unfortunately has no direct equivalent of refreshStubOnConnectFailure, but maybe you can sort of fake it by manipulating the server property of the FactoryBean). Would it be better to use that? How exectly are you using the server connection supplied by the ConnectionFactoryBean?


    • #3
      Thanks for the reply. I am getting connection as follows

      public JMXClient(MBeanServerConnection jmxConn, String mBeanObjectName) throws Exception {
      this.jmxConn = jmxConn;
      this.mBeanObjectName = new ObjectName(mBeanObjectName);

      private void initialise() throws Exception {
      clientRes = new MYJMXClientResult(jmxConn);
      beanInfo = jmxConn.getMBeanInfo(mBeanObjectName);
      operationInfos = beanInfo.getOperations();