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

  • tomcat restart issue with jmx

    Hi,

    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="org.springframework.jmx.support.MBeanServer ConnectionFactoryBean>
    <property name="serviceUrl"
    value="service:jmx:rmi://localhost/jndi/rmi://localhost:1099/test"/>
    <property name="environment">
    <props>
    <prop key="jmx.remote.jndi.rebind">true</prop>
    </props>
    </property>
    </bean>

    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?

    Comment


    • #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);
      initialise();
      }

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

      Comment

      Working...
      X