4 Replies Latest reply on Sep 7, 2011 8:59 PM by nathandennis

    Many Seam applications in one EAR

    povder

      Hi


      I am using Seam 2.2.2 with JBoss AS6. I want to have access to Local interface of some EJBs, so these EJBs have to be deployed in the same EAR that client application.


      I want to use these EJBs in two Seam applications, so these applications must be deployed in one EAR along with EJBs, and there is the problem. I have two components.xml in two WARs, but how do I specify what EJB module with Seam components should be used by particular WAR? For example, I have two authenticator components in application-1-ejb and application-2-ejb, how to force application1.war to user authenticator from application-1-ejb and not from application-2-ejb? I want to have two isolated Seam contexts.


      EAR contents:
      - common ejb module
      - application-1.war
      - application-1-ejb.jar
      - application-2.war
      - application-2-ejb.jar
      - jboss-seam.jar


      Thanks in advance for any hints.


        • 1. Re: Many Seam applications in one EAR
          nathandennis

          there is so much wrong here im not sure where to start.... first why are you wanting two seams context in the same application? if you dont want the same context, then what is the problem with just deploying two ears? are these local interfaces part of a legacy app you are trying to mesh with seam? RCP or something?

          • 2. Re: Many Seam applications in one EAR
            povder

            Nathan Dennis wrote on Sep 07, 2011 19:25:


            there is so much wrong here im not sure where to start.... first why are you wanting two seams context in the same application? if you dont want the same context, then what is the problem with just deploying two ears? are these local interfaces part of a legacy app you are trying to mesh with seam? RCP or something?



            These EJBs have local and remote interfaces and are used by a several applications, I guess you can call them legacy. I just wondered if there is a way to have two distinct Seam applications in one EAR, I know I can deploy these applications as two EARs and have ejb-jars of these EJBs I want to call in both EARs.

            • 3. Re: Many Seam applications in one EAR
              nathandennis

              i definitely think trying to stuff two seam context in one ear is the wrong way to go. if you just have to share the EJBs instead of having two copies connect to them remotely via two separate seams applications.

              • 4. Re: Many Seam applications in one EAR
                nathandennis

                i think this is the same idea we used in a rcp client a while back for remote connections. you could share the EJBs without all of the multiple mess in a single ear.


                     
                          try {
                               TestHandlerRemote sess =null;
                               Context context = new InitialContext();
                               session = (TestHandlerRemote) context.lookup("rcptest/TestHandlerBean/remote");