6 Replies Latest reply on Apr 13, 2012 7:43 AM by gerdwagner Branched from an earlier discussion.

    Passing EJB proxies between servers

    gerdwagner

      I just found another problem:

       

      - I have a bean that is deployed on the client server.

      - I (via method parameter) pass the remote interface of that bean to the destination server.

      - From inside the destination server when I call a method of that bean I get a 'No EJB receiver ...' exception.

       

      Here is the code that runs on the destination server, that does the callback:

       

      @Singleton

      public class DestSingletonBean implements DestSingleton

      {

          private ClientCallback clientCallback;

       

          @Override

          public void setClientCallback(ClientCallback clientCallback)

          {

              this.clientCallback = clientCallback;

          }

       

          @Schedule(second = "*/2", minute = "*", hour = "*", persistent = false)

          public void invokeCallback()

          {

              if(null != clientCallback)

              {

                  clientCallback.invokeBack();

              }

          }

      }

       

       

      Please let me know if you want me to open another issue for this point.

        • 1. Re: Passing EJB proxies between servers
          jaikiran

          Gerd Wagner wrote:

           

           

          Please let me know if you want me to open another issue for this point.

          I branched it to a separate topic.

          • 2. Re: Passing EJB proxies between servers
            jaikiran

            Gerd Wagner wrote:

             

            I just found another problem:

             

            - I have a bean that is deployed on the client server.

            - I (via method parameter) pass the remote interface of that bean to the destination server.

            - From inside the destination server when I call a method of that bean I get a 'No EJB receiver ...' exception.

            Does the destination server have the same bean with the same remote view, deployed within an application whose appname modulename and distinctname match with the one on the client server?

            • 3. Re: Passing EJB proxies between servers
              gerdwagner

              The callback bean is only deployed on the client server. All the destination server knows of the bean is its remote interface.

               

              I thought that was a save way to make sure the callback method runs inside the client server.

              • 4. Re: Passing EJB proxies between servers
                jaikiran

                Gerd Wagner wrote:

                 

                All the destination server knows of the bean is its remote interface.

                 

                 

                That way the destination server has no knowledge of where the bean is deployed. If you want to communicate back with the client server you'll have to do similar configurations that you did on the client server, except that the destination server will now act as the client server.

                • 5. Re: Passing EJB proxies between servers
                  jaikiran

                  To be more clear, the proxy that's sent around doesn't contain any information about where it was created and that is intentional.

                  • 6. Re: Passing EJB proxies between servers
                    gerdwagner

                    If I understand that right there would be a problem if I had more than one client server that want the destination server call back on them. Is that correct?

                     

                    In fact this is part of our scenario that I try to port from JBoss 6 to JBoss 7.