2 Replies Latest reply on Jul 23, 2007 11:06 PM by Alena Sviridova

    Clustered local interfaces? Really?

    Alena Sviridova Newbie

      Hi guys,

      I ask awfully lots of questions recently but bear with me. I found something truly weird. I wanted to see what happens if I declare local interface as clustered in jboss.xml. I did not expect that it would work just like remote. Does anyone have an explanation?

      the only thing which is different was logging. At startup JBoss told me:
      [org.jboss.ejb.StatefulSessionContainer] *** EJB 'WorkAddress' deployed as CLUSTERED but not a single clustered-invoker is bound to container ***

      but after that my EJBLocalHome and EJBLocalObject work as if they were cluster-aware EJBHome and replica-aware EJBObject.

      Any ideas???

      Here is my code.

      I did

      <ejb-name>WorkAddress</ejb-name>
      <local-jndi-name>WorkAddressLocal</local-jndi-name>
      true


      then started two nodes in JBoss with sticky OFF.

      I do servlet->SessionFacade (Stateful Session Bean)->Local statefull session bean (my WorkAddressLocal)

      My session facade has 2 instance variables, reference to EJBLocalHome and reference to EJBLocalObject. I initialize them when my Session Facade is called the first time. After that I store Session Facade bean in the session. Second requests comes around and gets load-balanced to the other node. Over there I successfully recover my Session Facade which has 2 references and test both of them:

      test LocalHome
      //workAddressHome was created earlier in ejbCreate
      WorkAddressLocal bean = workAddressHome.create();
      bean.test(); //success


      test EjbLocalObject
      //workAddressLocal was created earlier in ejbCreate
      workAddressLocal.test();//success also !
      ....

      Many thanks if anyone who can shed some light on the matter