1 Reply Latest reply on Oct 2, 2012 2:07 PM by cfang

    Is it possible to deploy multi-applications in order in Jboss7?


      Hi everyone,


      I am looking for a way to deploy applications in order so that one service can be deployed after finishing initialisation of antoher sercive.


      In detail

      I have a ejb ejb.jar who have the Hibernate Session Factory JNDI binding called java:jboss/hibernate/SessionFactoryWeb.

      Another application app.ear opens the hibernate session to fetch some data when it's being initializing in the deployment processs as its class having @startup annotation


      However, when app.ear is being deploy, the ejb service from  java:jboss/hibernate/SessionFactoryWeb is not yet started becase ejb.jar is not yet finished deploying. So I cannot deploy app.ear.


      Some sollutions possible


      1. Deploy the applications in order manually.
        But I do not want to do this because I think its no good for production.

      2. Make the services as Ejb singleton with the depends annotation. 

              But I don't think it is my case.


      Do any one have some experience or some idea ? Thanks in adavance.

        • 1. Re: Is it possible to deploy multi-applications in order in Jboss7?

          You can package ejb.jar inside app.ear, and specify intialization order in application.xml (Java EE 6 or later).  Or you can implement both sides as @Singleton @Startup, with the consuming side @DependsOn the provider side.


          If your ejb service is implemented as @Startup singleton, in its @PostConstruct, it should complete all init logic before returning from deploy command.  So even if you deploy them separately in sequence, the second deploy is guaranteed to have a completely initialized service from the first deploy