2 Replies Latest reply on Jul 14, 2008 7:13 AM by Victor Andreev

    Problem with Application context when deploy two ear (based on seam).

    Victor Andreev Newbie

      Please, help...
      I put two ear based on JBSeam in jboss deploy. In first ear stateful session bean method is invoked from JNDI (remote inteface) for authentificate.


      /// Code from ear1


      if(service == null) {
          InitialContext context = JNDIContextService.getContext("service-jndi.properties");
          service = (IRmiService)context.lookup("service/RmiService/remote");
          saleTicketService.login("login", "passwd");
      }



      ///


      In other ea in session bean do next:


      /// Statefull from ear2


      Lifecycle.mockApplication();
      Lifecycle.beginCall();
      Lifecycle.beginSession(new Hashtable<String, Object>());
      Identity.instance().setUsername(username);
      Identity.instance().setPassword(password);
      Lifecycle.mockApplication();
      Identity.instance().login();
      Lifecycle.endCall();
      


      ///


      But Identity.instance().login(); doesn't work correctly. I have traced code and searched, that the Application context was changed during invoke Identity.instance().login() and it became same as context from first ea when execute EL authenticate-method #{Authenticator.authenticate}!?


      If i use two different jboss servers for ears, it works correctly...