4 Replies Latest reply on Jan 28, 2012 9:29 AM by jaikiran pai

    Remote EJB access and initialContext?

    markus78 Newbie

      Hello,

       

      We use the Jboss API to dynamically select wich server to lookup remote EJB's from , but we have problems.

       

      Imagine the following case

       

       

      pseudo code:

       

                EJBClientContext.setSelector(SelectorA);

                ctx = new InitialContext(propsA);

       

                EJBClientContext.setSelector(SelectorB);

                context = new InitialContext(probsB);

       

               ctx.lookup(bean_on_serverA);

               context.lookup(bean_on_serverB);

       

      Will this work?

      Wont the "ctx" context still use SelectorB (the last set selector) to search for EJB's and thus searching on the wrong server? In all previous JBoss versions one would specify in the initialContext which server to work with and that context

      would keep track of this, it is a real pain if we have to implement this ourselves and keep track of the singleton EJBClientContext class in all cituations.....

       

      Our real application is lots more complicated with spring lookup of slsb's mixed with manual lookups wich makes it very very hard to keep track of these things ourselves.

       

      /Markus