0 Replies Latest reply on Jul 24, 2008 10:48 AM by ravi vemuri

    MBean work, but with buggy behavior

    ravi vemuri Newbie

      My application used 2 Stateless MBeans A and B (same JVM) deployed to JBoss AppServer, and accessed via JMX Console client, in addition to MBean to MBean calls. MBean A is CLIENT to MBean B. MBean B declares an IP Addr to which the bean opens a socket connection. This address can be modified by invoking a management operation "restart()" from the JMX Console client. The inconsistent behavior that I am unable to resolve is as follows: I deploy both beans from one ear file. I invoke operations from MBean A to MBean B without problems. I then restart() MBean B from JMX Console which modifies the IPAddr private member attribute. The code in MBean A looks up MBean B reference every single time before invoking operations. But somehow, MBean A, sees a "cached" value for the IPAddr variable. MBean A seems to be using a stale reference to MBean B, no matter how many times MBean B is modified. Relevant code in MBean A is as folows:
      @Management(MBeanA.class
      @Service(objectName=MBeanA_stringname)
      @Depends(MBeanB_string_name)
      MBeanServer server = MBeanServerLocator.locate();
      mbeanBref = (MBeanB)MBeanProxyExt.create(MBeanB.class, mbean_name_string, server);
      mbeanBref.openSocketConnection();

      What am I missing that would enable most current state of EJB B to be always accessible from EJB A (i mean MBeans A and B) ?

      thanx,
      rv