8 Replies Latest reply on Mar 10, 2014 11:41 PM by masummymesingh

    which one is good (EAR/WAR) for JAVA EE 7

    masummymesingh

      I am developing a multi-module project with JAVA EE 7 (EJB + JSF).  for higher modularization requirement which one is good  EAR / WAR ?


      My app structure is :

      jboss-all.png

       

       

      Multiple EAR for Same App (like large ERP app). is it appropriate  for  modularization requirements ???

      Exp : one application has two module -- one is : accounting , customer

       

      app1.ear ---accounting module (only EJB)

      app2.ear --- customer module  (only EJB)

      base.ear ---- all web module    (only web)

       

       

      any pls give me a description about dangerous effect for this modularization ?????????????

        • 1. Re: which one is good (EAR/WAR) for JAVA EE 7
          lafr

          Your question is not 100% clear to me, but for a multi-module Java EE application I'd definitely use an EAR as the deployment unit.

          You can set up separate source folders / packages per module, have dedicated build for each module and put the jar or war result into your ear, referencing it in application.xml.

          • 2. Re: which one is good (EAR/WAR) for JAVA EE 7
            hwellmann.de

            I've been using WARs exclusively as deployment units ever since Java EE 6.

             

            Using a Maven reactor project, I have modules/subprojects with separate source directories and separate artifacts. There is one module with war packaging which depends on all other modules and packages them in WEB-INF/lib. No need for an application.xml.

            • 3. Re: which one is good (EAR/WAR) for JAVA EE 7
              ctomc

              Harald Wellmann wrote:

               

              I've been using WARs exclusively as deployment units ever since Java EE 6.

              Absolutely wrong!

               

              EE6 has made ear less common practice as you can do most of the stuff in wars now, but ears are still required when your application has for example more than one war....

              • 4. Re: which one is good (EAR/WAR) for JAVA EE 7
                masummymesingh

                pls give me a idea about when using multiple ear as a single app ?????

                • 5. Re: which one is good (EAR/WAR) for JAVA EE 7
                  rhusar

                  Gulam Samdani wrote:

                   

                  pls give me a idea about when using multiple ear as a single app ?????

                  When? Almost never. You would typically stick to one application = one .ear archive.

                   

                  If you meant to ask when to use multiple wars, then imagine having front-office and back-office, then you would split it to 2 wars.

                  • 6. Re: which one is good (EAR/WAR) for JAVA EE 7
                    masummymesingh

                    pls consider for my first posting .

                    • 7. Re: which one is good (EAR/WAR) for JAVA EE 7
                      wdfink

                      You can go with that approach, only thing to consider is that you need to know the ear names as you need to invoke a EJB outside of the web-app.

                      So you might have a indirection with ejb-references or you rely on the names.

                      Also you should consider whether the ejb applications should be always called local (it will have a better performance)

                      • 8. Re: which one is good (EAR/WAR) for JAVA EE 7
                        masummymesingh

                        My App is small size ERP app . it has some module (10): accouning, customer infor , inventory etc.

                        i want to deploy this app indepently .

                         

                        our requirement is : when deploy accounting module no impact other module .

                         

                        but i saw that if i use local ejb , it can not deploy without other dependent module but when use remote ejb

                        it does not any give any error for compile and deploy time expect run time .

                         

                        so, i am use Remote ejb (distributed system)