2 Replies Latest reply on Jul 23, 2019 4:58 AM by adrient

    Wildfly order of deployment

    adrient

      Hi all,

       

      I have a Wildfly 10 instance where I deploy, in domain mode, many applications (~12, ears and wars) that call each other via EJB calls.

       

      The first time I am deploying my applications I control the order of deployment and that is fine. Any dependency between my ears is respected. The problem is when I restart a node from my domain cluster. Wildfly tries to be smart about the order of deployment but can't guess the right order. So what can happen:

      • I have app A and B
      • I have node 1 and node 2 (say node 1 is the domain controller)
      • B is referencing an EJB in A
      • at first deployment I deploy first A then B. When B deploys it will find A and everything is ok.
      • if I restart node 2 then Wildfly will deploy apps in a different order than the first deployment. I can therefore have B deployed first, looking for my EJB in A, then fails the start of the node.

       

      I've already spent quite some time trying to play with things like jboss-all.xml to have some strict dependencies between my app. But this comes with serious side effects like the inability to redeploy an app on the fly without redeploying the whole cluster ; indeed Wildfly will consider that if B depends on A and A is redeployed then B should be as well.

       

      I can't believe I am the first one going through that. How are you managing that part on your Wildfly? Is there not an easy way to control the order of a "re" redeployment?

       

      Ultimately I could switch all my nodes to standalones and manage them separately but it would be a real shame.

       

      Thanks

      Adrien

        • 1. Re: Wildfly order of deployment
          ctomc

          to order deployments on same server use jboss-all.xml with deployment dependencies configured

          • 2. Re: Wildfly order of deployment
            adrient

            Thanks Tomaz.

             

            Unfortunately this solution doesn't work for me. As explained I tried to use it but the problem with the jboss-all.xml is that Wildfly will keep that strong dependency if I redeploy on the fly an app. I sometimes do that when patching part of my stack. For example:

            • B is referencing A in jboss-all.xml
            • I need to patch and redeploy app A
            • When redeploying A then Wildfly will automatically redeploy B

            This can be a real problem if, in the above example, A is an EAR containing a few EJBs and B a webapp. I may want to redeploy those EJBs in app A without impacting my whole app but here my site could become completely offline while Wildfly redeploys, needlessly, B.

             

            Does that make sense?

             

            Thanks

            Adrien