3 Replies Latest reply on Jul 14, 2009 8:50 PM by wangliyu

    Seam Web App in a separate Tomcat and JBoss

    yk

      Hi all,


      Is it possible to deploy a seam web application in a separate tomcat/jboss servers ?
      - Tomcat (War) - JNDI to talk to the remote App server
      - JBoss (JAR)


      I'm wondering how the seam contexts are managed using this configuration.


      Example:
      On the UI (i.e. Tomcat) side, we have the facelets and the ejb remote interfaces to call
      the remote app (i.e. JBoss) server. On this latter we have the statefull actions.
      In this case, how to reference a component (app side - remote server) in the facelets (UI side) ?
      In addition, when we talk about a session scoped component (an action for example), is it the tomcat (ui side) session or a jboss one (remote app server)



      thank you,


        • 1. Re: Seam Web App in a separate Tomcat and JBoss
          swd847

          Seam is not really designed for what you are trying to do. You can probably make it work, here are some hints:


          1) The jboss app server needs a war file, so you probably want to deploy it as an ear with an empty war. Seam needs the war because it is bootstraped by the servlet listener and the appication context is actually a wrapper around the servlet context.


          2) You will actually have 2 seam apps running, with seperate app contexts and component instances. Your tomcat one will be the main one, session scoped components are referring to the life of the tomcat session.


          3) You will probably need to use some kind of remote procedure call and do Lifecycle.beginCall() to set up the contexts. You will have to decide what kind of RPC method you want to use here.


          4) Just because it can be done does not mean it is a good idea. Looking at your problem seam 2.x is probably not that suited for the backend side of things.

          • 2. Re: Seam Web App in a separate Tomcat and JBoss
            yk

            Thanks Stuart for your quick answer.


            One more question :
            If seam is not designed for this kind of web applications, so there is no need for ejb (ejb3) ?


            As far as I know, one goal of the ejb is to allow distributed system to intercommunicate.


            If this feature is no longer possible with seam, then ejb is useless since seam made it possible to use simple POJO.

            • 3. Re: Seam Web App in a separate Tomcat and JBoss
              wangliyu

              Seam seems doesn't support this deploy model, you can use Seam with POJO and deploy it on TC, POJO mapping to backend EJB. and your EJB will be standard EJB.