1 2 Previous Next 29 Replies Latest reply on Nov 4, 2008 10:21 AM by adrian.brock

    SAR Deployment Deployers Ordering

    ropalka

      Relates to: JBWS-2246
      ---

      Usecase 1: Service archive (.sar) with POJO web service endpoint (.war archive inside).
      Usecase 2: Service archive (.sar) with EJB web service endpoint (.jar archive inside).

      Problem Description:
      ---

      Both usecases work fine when we deploy service archive to already running AS instance (using hot deploy feature).
      The problem appears when service archive is present in deploy directory at AS startup time.

      Current JBossWS Deployers Architecture:
      ---

      There are three JBossWS deployers registered with the JBoss Main Deployer which order is important:

      EJBDeployer < WebServiceDeployerEJB < WarDeployer
      WebServiceDeployerPreJSE < WarDeployer < WebServiceDeployerPostJSE

      Questions:
      ---
      When sar deployment (containing .war) is in place the war archive deployment order is different comparing to when war archive is deployed standalone :(
      Q1: Is it correct deployers behavior?
      Q2: Shouldn't war or ejb archive inside .sar archive be deployed later?

        • 1. Re: SAR Deployment Deployers Ordering
          ropalka

          To clarify our question:

          When we have pure .war archive (containing web services) in deploy directory,
          the deployment process passes on AS bootstrap (our PostJSE deployer is called after Tomcat is started).

          When we have .sar archive containing .war archive (containing web services),
          the deployment process fails on AS bootstrap (our PostJSE deployer is called before Tomcat is started).

          • 2. Re: SAR Deployment Deployers Ordering
            alesj

            Deployers order is deterministic.
            Even if that's not the case (e.g. possible bug),
            there is no way the order is changed during deploy.

            Since this example indicates that deployers order is different
            when you have pure .war vs. war wrapped in .sar - during deploy on the same instance.

            What might be different is that top level deployments are ordered by LegacyComparator,
            - see deployers.xml and ear-deployer-jboss-beans.xml -
            where other sub deployments are only ordered by relative order or name.

            But that shouldn't affect deployers order, only deployment order.
            Although with dependencies done right, this shouldn't matter anyway. ;-)

            • 3. Re: SAR Deployment Deployers Ordering
              ropalka

               

              "alesj" wrote:

              But that shouldn't affect deployers order, only deployment order.

              You're right, this is better said. The deployment order has changed not deployers order.
              "alesj" wrote:

              Although with dependencies done right, this shouldn't matter anyway. ;-)

              So it is expected that .sar archive (defining e.g. custom MC beans) should define dependency on other MC beans to ensure correct deployment order of such .sar?
              I'm asking because I'd like to deploye simple .sar archive without MC beans containing just e.g. .war archive only). I'd like to see the same deployment order of nested .war vs. standalone .war? How could we ensure this Ales?



              • 4. Re: SAR Deployment Deployers Ordering
                alesj

                 

                "richard.opalka@jboss.com" wrote:
                I'd like to see the same deployment order of nested .war vs. standalone .war? How could we ensure this Ales?

                See how we do it for EARStructure in ear-deployer-jboss-beans.xml.
                --> comparator setting

                Try doing the same for JARStructure (that's the structure that handles .sar).
                Or use custom jboss-structure.xml in your .sar (see examples of this in Deployers project),
                setting the comparator attribute on context element.
                Note: this requires deployers 2.2.0-SNAPSHOT, as I've just added this comparator attribute :-)
                - https://jira.jboss.org/jira/browse/JBDEPLOY-120

                • 5. Re: SAR Deployment Deployers Ordering
                  ropalka

                   

                  "alesj" wrote:

                  Or use custom jboss-structure.xml in your .sar (see examples of this in Deployers project),
                  setting the comparator attribute on context element.

                  This approach sounds better to me.
                  "alesj" wrote:
                  Note: this requires deployers 2.2.0-SNAPSHOT, as I've just added this comparator attribute :-)
                  - https://jira.jboss.org/jira/browse/JBDEPLOY-120

                  What is the difference between deployers 2.0.0 and 2.2.0? Will 2.2.0 be incorporated in JBossAS 500 GA?


                  • 6. Re: SAR Deployment Deployers Ordering
                    alesj

                     

                    "richard.opalka@jboss.com" wrote:

                    What is the difference between deployers 2.0.0 and 2.2.0? Will 2.2.0 be incorporated in JBossAS 500 GA?

                    No, 2.0.0 is.
                    2.2.0 is currently our dev branch == trunk.
                    2.0.0. gets non-api-breaking fixes from trunk.

                    This new comparator addition doesn't break API,
                    hence it's gonna be part of 2.0.0.

                    btw: I'm just doing releases ;-)

                    • 7. Re: SAR Deployment Deployers Ordering
                      ropalka

                      I'm almost there Ales ;)
                      There's just one problem remaining.
                      My .sar is loaded first, jbossweb.sar is loaded later.
                      How could I reorganize/force the .sars deployment order?
                      Note I have no MC beans in my .sar archive.

                      • 8. Re: SAR Deployment Deployers Ordering
                        alesj

                         

                        "richard.opalka@jboss.com" wrote:

                        How could I reorganize/force the .sars deployment order?

                        Either rename your .sar to be lexicographically after jbossweb.sar,
                        or change topDeploymentComparator in MainDeployer.

                        Or perhaps some introduction of explicit dependency
                        to whatever you depend in jbossweb.

                        • 9. Re: SAR Deployment Deployers Ordering
                          ropalka

                           

                          "alesj" wrote:
                          Or perhaps some introduction of explicit dependency
                          to whatever you depend in jbossweb.

                          How to achieve this without MC beans? Where could I find this usecase examples?

                          • 10. Re: SAR Deployment Deployers Ordering
                            ropalka

                            Or do we expect that .sar archives have to incorporate MC beans?

                            • 11. Re: SAR Deployment Deployers Ordering
                              alesj

                               

                              "richard.opalka@jboss.com" wrote:
                              Or do we expect that .sar archives have to incorporate MC beans?

                              No. Why would that make sense?
                              Wait for a better answer as I do more investigation. ;-)

                              • 12. Re: SAR Deployment Deployers Ordering
                                alesj

                                 

                                "richard.opalka@jboss.com" wrote:

                                How to achieve this without MC beans? Where could I find this usecase examples?

                                What do you have in your .sar? MBeans?

                                With MC handling all components (read my article ;-)),
                                MBeans can now also depend on MC pojos.

                                Or perhaps you could add jboss-classloading.xml into your sar,
                                where you would declare dependency on jbossweb.sar module.
                                I guess we already enabled this in MC. :-)

                                • 13. Re: SAR Deployment Deployers Ordering
                                  ropalka

                                   

                                  "alesj" wrote:

                                  What do you have in your .sar? MBeans?

                                  No, just web archive (incorporating WebService endpoints our deployers operate with)
                                  "alesj" wrote:
                                  With MC handling all components (read my article ;-)),

                                  Which article? On your blog?



                                  • 14. Re: SAR Deployment Deployers Ordering
                                    alesj
                                    1 2 Previous Next