1 2 3 Previous Next 37 Replies Latest reply on Feb 20, 2013 3:31 AM by bmaxwell

    Deployment order for multiple EARs

    kristjan273

      Hi,

       

      I wonder how the multiple EARs can be deployed in particular order. In jboss 4.2.3 I was used to solve the case where one ear was needed to be deployed before others by putting it to /deploy and others in /deploy.last

       

      Is this stuff solved somehow inside as 7 (particulary 7.1.BETA1)?

        • 1. Re: Deployment order for multiple EARs
          alesj

          Why exactly do you need this particular explicit order?

          • 2. Re: Deployment order for multiple EARs
            rhusar

            Since everything in AS7 is done in parallel, relying on the order of deployment sounds like a very bad idea to me.

            • 3. Re: Deployment order for multiple EARs
              alesj

              Well, one could still depend on CL module, knowing you can properly load an external class.

              But that already comes as part of declaring actual ext module dep.

               

              Imo, any vaild service dependency; e.g. remote EJBs, should also already be taken care of.

               

              Hence the question what is missing aka why the explicit order.

              Perhaps there is a missing valid use case we should also cover. ;-)

              • 4. Re: Deployment order for multiple EARs
                daveryan

                You might like to use the Management CLI to order your deployment schedule, using the Batch features to ensure that your deployments occur in the order scripted, and with the peace of mind of an automatic rollback should one fail.

                 

                • 5. Re: Deployment order for multiple EARs
                  kristjan273

                  Ales Justin wrote:

                   

                   

                  Imo, any vaild service dependency; e.g. remote EJBs, should also already be taken care of.

                   

                   

                  @Ales

                  this is exactly what I need I think (but still little in the dark how to achieve).

                   

                  I have legacy app written on top of as4.2.3 where one core ear comprises all the needed business logic and some smaller 'add-ons' ears which dynamically register to some service mbeans inside core ear. That was achieved by putting core.ear to /deploy dir and all the 'add-ons' to /deploy.last

                   

                   

                  So, I would be very glad to hear a hint how to solve this usecase. By reading stuff I admit I don't see the way how to achieve remote EJBs dependency through multiple ears.

                   

                  (I am also open to switch the development paradigm If you see I do things terribly wrong)

                   

                  tnx in advance

                  • 6. Re: Deployment order for multiple EARs
                    kristjan273

                    @Aleš Justin

                    Were you maybe able to discuss proper people on the topic? Any new info?

                    • 7. Re: Deployment order for multiple EARs
                      alesj

                      They just added inner explicit order:

                      * https://github.com/jbossas/jboss-as/commit/215f2e54cf7f50ab6d1b896423f744508582cdca

                       

                      I need to catch Stuart or DML to see what exact plan is for top level deployments.

                      • 8. Re: Deployment order for multiple EARs
                        alesj

                        I need to catch Stuart or DML to see what exact plan is for top level deployments.

                        It's mostly like I already explained it to you - in person at that time. :-)

                         

                        You would need to go at a MSC level, and add proper cross dependencies + service listener with sort of "countdown",

                        to know when the dependant deployment is complete -- all its services hit stable state.

                         

                        But it's not simple ... parallel things never are. :-)

                        Hence I suggest you find a workaround for your use case. ;-)

                         

                        Some input from Stuart:

                         

                        stuartdouglas
                        1:20
                        its actually kinda complex
                        1:20
                        basically it is when all the services in a deployment have hit a stable state
                        1:21
                        have a look at org.jboss.as.controller.ServiceVerificationHandler
                        1:21
                        and org.jboss.as.controller.ContainerStateMonitor
                        1:22
                        stuartdouglas
                        1:22
                        I think the idea is CSM monitors the whole container for service state changes, and a deployment cannot complete until the whole container is settled
                        And ServiceVerificationHandler is a per deployment thing
                        
                        
                        • 9. Re: Deployment order for multiple EARs
                          justdoit

                          I am facing very similar problems.

                           

                          One "master" ear, which should be deployed first in line, and other ears, which depend on successfull deployment of master ear

                          and should be deployed only after master has finished with deployment.

                           

                          I saw an "Add the deployers" article on jboss site and thought it could be the solution to our problem

                          (write a custom deployer, and check the deployment order at that place).

                           

                          Would this be the correct approach or have I gone the wrong way?

                          • 10. Re: Deployment order for multiple EARs
                            alesj

                            I saw an "Add the deployers" article on jboss site and thought it could be the solution to our problem

                            (write a custom deployer, and check the deployment order at that place).

                            This is probably for version pre-7; AS4,5,6.

                             

                            But it would probably have to be similar.

                            You would have to extend AS7, with own sub-system (or add things to an existing).

                            Where you would then add a DeploymentProcessor(s) (similar concept to previous mentioned Deployers),

                            which would understand cross-dependencies and act accordingly -- add proper MSC service listeners, etc.

                            • 11. Re: Deployment order for multiple EARs
                              justdoit

                              Thanks for the quick response.

                               

                              Here's the link to the article: https://docs.jboss.org/author/display/AS7/Add+the+deployers

                              • 12. Re: Deployment order for multiple EARs
                                stepanov

                                Ales (or somebody from JBoss designers), could you please provide more details on how do I implement such a service?

                                 

                                Let's say, I have ear1.ear, ear2.ear and war1.war. Let's also assume that:

                                1) ear2 must start after ear1 and war1 must start after ear2

                                2) proper order cannot be obtained by using injections (for whatever reason e.g. using explicit JNDI lookups)

                                3) using CLI for deployment is not an option, too

                                 

                                I started with creating of skeleton for my service as described here https://docs.jboss.org/author/display/AS7/Example+subsystem.

                                My service can obtain its configuration from standalone.xml and can find dependency information (war1->ear2->ear1) from some source (let's say, another file).

                                What should I put into my DeploymentUnitProcessor.deploy() method? How can I tell JBoss deployment system that particular units must be started in specific order?

                                • 13. Re: Deployment order for multiple EARs
                                  tpc1095

                                  Hi Ales, Oleg and all,

                                   

                                  Any progress on this?   My deployment fails because the .war file has started to get deployed first for some random reason.  It needs a JMS queue in the .esb that isn't up yet.  Another complication is the ESB uses AS version 4.2 or such (and apparently there are no plans to up grade this.)

                                   

                                  For anyone reading this, startup dependencies are a key architectural feature (take a look at OSGi for example) and not a fringe case. 

                                   

                                  Tim

                                  • 14. Re: Deployment order for multiple EARs
                                    kristjan273

                                    Tim:

                                         I agree with you and surely vote for such functionality to be implemented or some other simmilar pattern is presented which would solve the original issue with some application level dependecies/order.

                                     

                                    Oleg:

                                         Also in answer to you, I would go for such implementation (as would probably do the trick for my problem) but extending as7 is a bit to advanced for now for me. So, if some guru would put some hour or two to implement this I would be very glad.

                                    1 2 3 Previous Next