8 Replies Latest reply on Oct 17, 2005 12:53 PM by tomdee

    Deployment order of .ear file

    parressh

      Hi, I'd like to setup the deployment ordering so that an .ear file is not deployed until tomcat is finished loading. I am using JBoss 4.0.2 and have not quite found what I am looking for on the forums already.

      Does anyone know how to set up the dependencies properly and where in the ear this is specified?

      Thanks,
      Matthew

        • 1. Re: Deployment order of .ear file
          darranl

          What is the reason you are asking this?

          Have you encountered a problem and you think this is the solution or is there another reason for this?

          • 2. Re: Deployment order of .ear file
            parressh

            During the deployment of my application, it is using a library that is trying to initialize a web service client call to a service exposed by another ear in the same jboss instance. Since tomcat has not finished loading, the http call just hangs in a deadlock. App is waiting for tomcat, tomcat is waiting for app.

            Thanks

            • 3. Re: Deployment order of .ear file
              tomdee

              Env: JBoss 3.2.6

              we have similar issue in that our .ear file contains both an MDB as well as a servlet that is loaded during startup.

              The MDB uses resources that are initialized and allocated by the servlet.

              All is well if JBoss is started and the MDB JMS Queue is empty.

              If JBoss is re-started following a crash, the JMS queue may be full and JBoss will start firing off the MDBs, which in turn, will start to use the resources that may or may not have been initialized yet.

              I've looked at adding the depends tag in jboss.xml as per jboss_3_2.dtd

              <message-driven>
              ....
              ...
               <depends> ... </depends>
              
              </message-driven>


              however, i have no clue as to what should go inside the depends tag.

              My init servlet shows up on the jmx-console under various names

              jboss.jetty:Server=0,JBossWebApplicationContext=2,context=/myapp,name=initservlet

              jboss.web.deployment:war=myapp.war,id=161905223



              • 4. Re: Deployment order of .ear file
                tomdee

                actually i got a bit further and got it to work if i use

                <depends>jboss.web.deployment:war=myapp.war,id=-161905223</depends>


                but there's still an unknown dependency on id=-161905223

                any help would be welcome

                Thanks.

                • 5. Re: Deployment order of .ear file
                  ramone1234

                  How did you solve the id attribute dependency?
                  We've got a similar problem.
                  In the "jboss.monitor:service=CiwebMonitor" mbean deployment file, we must define a mbean dependency as it follows:

                  <server>
                  <mbean code="org.jboss.monitor.LoggingMonitor" name="jboss.monitor:service=CiwebMonitor">
                  <classpath codebase="lib" archives="loggingmonitor.jar"/>
                  <attribute name="Filename">${jboss.server.home.dir}/log/ciweb.log</attribute>
                  <attribute name="AppendToFile">true</attribute>
                  <attribute name="RolloverPeriod">DAY</attribute>
                  ...
                  <depends>jboss.web.deployment:war=web-console.war,id=-703441128</depends>
                  ...
                  </server>
                  


                  After each JBoss restart, a new id is generated for the mbean "jboss.web.deployment:war=web-console.war", and it crashes the deploy of "jboss.monitor:service=CiwebMonitor" mbean service.
                  How am I supposed to define this random id?
                  Any idea would be very helpful.

                  Thanks in advance.

                  Fernando

                  • 6. Re: Deployment order of .ear file
                    tomdee

                    Sorry I haven't. I was hoping someone else would have an idea.

                    • 8. Re: Deployment order of .ear file
                      tomdee

                      Vasily,
                      Thanks for the information. I've seen that post before but we are still on 3.2.6. When does 3.2.8 come out?