3 Replies Latest reply on Jul 22, 2007 5:59 PM by Valerij Timofeev

    Can the EJBs be on a remote server ?

    Sanjay Kumar Newbie

      Hi Folks !

      I am reading up on Seam and all the discussion and examples are built around EJB server colocated with the Servlet/JSF container with heavy use of dependency injection to get refernces to local EJB server. It appears there is no standarized way to do dependency injection of remote references. Is this why we don't see remote EJB servers in Seam ?

      I would like to move EJB tier to a remote server located behind a firewall away from Tomcat container on the web server. I thought this was pretty standard configuration for 3-tier applications. Don't want to embed EJBs inside Tomcat and more importantly do not we want allow database access (through JPA) from the servlet/JSF (web) tier.

      Is there a simple way to deploy EJB tier on a remote server and if so how would Seam resolve references to them ? Can you define remote references in the web.xml ? Any examples, samples would be much appreciated.

      thanks,

      -Sanjay

        • 1. Re: Can the EJBs be on a remote server ?
          Gavin King Master

          you can inject a remote EJB using @EJB.

          • 2. Re: Can the EJBs be on a remote server ?
            Sanjay Kumar Newbie

            How ? I tried putting an @EJB injection in the JSF backing beans, and only way I could get it to work was when the JSF app was deployed to bundled JBoss/Tomcat. Even then following annotation was required:

            @EJB(name="testJbossEar/helloWorld/remote")

            I believe this is JBoss specific and not portable.
            Standalone Tomcat 6.0.13 ignored the @EJB annotation. I presume its a Tomcat limitation.

            Even if I decide to settle on a bundled Tomcat/JBoss for my client tier and use a pure JBoss for my remote server, how do you steer Seam towards remote Session beans specified in action field of JSF page ? Where would you put @EJB(location of remote server) annotation ?

            Its also not clear how Seam would obtain JPA entitity beans from remote server and inject them in JSF tier ?

            Any details, tips hints would be appreciated.

            thanks,

            -Sanjay

            • 3. Re: Can the EJBs be on a remote server ?
              Valerij Timofeev Newbie

               

              "femski1" wrote:

              I would like to move EJB tier to a remote server located behind a firewall away from Tomcat container on the web server. I thought this was pretty standard configuration for 3-tier applications.


              Actually a firewall is not an adequate motivation for deploying web- and EJB containers on different servers. A firewall between a web server (Apache, IIS etc.) and JBoss Application server (Web- and EJB container) would be more appropriate.