10 Replies Latest reply on Apr 14, 2008 4:54 PM by Gavin Ellis

    Correct structure for multiple war's in an ear?

    Troy Tarrrant Newbie

      HI,


      I have an application that I would like to deploy in modules with multiple ears and at this stage one ejb jar. However when I simply add another war file to the deployment I get this warning in the startup logs



      07:37:45,080 WARN  SeamPhaseListener There should only be one Seam phase listener per application


      And then a couple of deployments later random Jboss errors start happening and then it's a restart.


      What is the proper solution to deploying multiple wars and multiple ejb files in one application?


      Thanks


      Troy

        • 2. Re: Correct structure for multiple war's in an ear?
          Gregory Tanneau Newbie

          Hi all !


          I've had the same problem, deploying two WARs inside my EAR deployment unit :


          15:05:19,312 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.expressions
          15:05:19,312 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.web.userPrincipal
          15:05:19,328 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.locale
          15:05:19,328 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.bpm.businessProcess
          15:05:19,328 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.web.parameters
          15:05:19,328 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.security.identity
          15:05:19,328 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.locale
          15:05:19,343 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.web.isUserInRole
          15:05:19,343 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.manager
          15:05:19,343 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.persistence.persistenceProvider
          15:05:19,343 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.transaction.synchronizations
          15:05:19,343 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.resourceLoader
          15:05:19,375 INFO  [org.jboss.seam.Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
          



          I've read the two links above, but I can't find a solution.


          I use Seam 2.0.1.GA along side JBoss 4.2.1.GA.


          My deployment unit structure is the following :


          APP.EAR
            + META-INF/
              - application.xml
              - jboss-app.xml
            + lib/
              - jboss-el.jar
              - ...
            + APP.JAR/
              + com/my/classes/
              + META-INF/
                - ejb-jar.xml
                - persistence.xml
              - seam.properties
            + APPONE.WAR/
              + web-content/
              + WEB-INF/
                + classes/
                + lib/
                  - commons-beanutils.jar
                  - commons-digester.jar
                  - jboss-seam-ioc.jar
                  - jboss-seam-mail.jar
                  - jboss-seam-pdf.jar
                  - jboss-seam-remoting.jar
                  - jboss-seam-ui.jar
                  - jsf-facelets.jar
          
                - components.xml
                - faces-config.xml
                - pages.xml
                - web.xml
            + APPTWO.WAR/
               (idem)
          



          Given that, my problem is that my resource manager is only working fine for one of my two webapps.


          What am I doing wrong ?
          Is there a better way to do this ?


          Thanks !

          • 3. Re: Correct structure for multiple war's in an ear?
            Gregory Tanneau Newbie

            Actually the logs quoted before are not the problem.


            The problem comes from :


            WARN  [org.jboss.seam.jsf.SeamPhaseListener] There should only be one Seam phase listener per application
            



            ... when APPRWO.WAR is deployed.


            Then, I set up my two home pages like the following :


            APPONE's and APPTWO's home.xhtml :


            Welcome to <h:outputText value="#{messages['appName']}" />
            



            APPONE/home.seam responds

            Welcome to APPONE

            according to my resource bundle ;


            APPTWO/home.seam responds (too)

            Welcome to APPONE

            whereas it should be APPTWO...


            And vice versa if I load APPTWO first. The first accessed webapp holds all resources ...


            Any idea ?




            • 4. Re: Correct structure for multiple war's in an ear?
              Gregory Tanneau Newbie

              Still investigating :)


              It appears that Seam's ResourceLoader loads bundles at webmodule startup.


              When I start APPONE the first time :


              [org.jboss.seam.core.ResourceLoader] loaded resource bundle: messages_appone
              [org.jboss.seam.core.ResourceLoader] resource bundle missing: home
              



              Then, I start APPTWO


              [org.jboss.seam.core.ResourceLoader] resource bundle missing: home
              



              There,

              messages_apptwo

              should've been loaded (I guess/wish).



              Cf. JIRA JBSEAM-2364


              Is there a way to tell Seam's ResourceLoader to load bundles once per session, not at startup (or something like that) ?

              • 5. Re: Correct structure for multiple war's in an ear?
                Gregory Tanneau Newbie

                It seems weird that nobody has had this problem, isn't it ? :)


                Having two WAR module inside a EAR unit is a quite reasonable scenario.


                But in that configuration, the Seam ResourceLoader behaves as if there were only one WAR : it loads bundles it finds when the first webapp is started ; then when the second webapp is started, it assumes budles are already loaded : there should be one ResourceLoader per WAR module.


                Should I create a JIRA ? Can someone just tell me what to do ?

                • 6. Re: Correct structure for multiple war's in an ear?
                  Pete Muir Master

                  I agree, it's not clear what is going wrong/on here - file a JIRA, and we can at least document better.

                  • 7. Re: Correct structure for multiple war's in an ear?
                    Gregory Tanneau Newbie

                    This JIRA JBSEAM-2364 addresses the same issue. I commented it with my test case.


                    Pleased to help.

                    • 8. Re: Correct structure for multiple war's in an ear?
                      Pete Muir Master

                      That JIRA is a feature request for being able to merge messages.properties of the same name from different modules, what you are asking is different, so I suggest a new JIRA.

                      • 10. Re: Correct structure for multiple war's in an ear?
                        Gavin Ellis Newbie

                        Hi Gregory, are you saying here that your second war is identical to the first? If not, could you please provide the war listing for the second war. Thanks.