6 Replies Latest reply on May 7, 2003 5:59 PM by manuelf

    Deployment broken in 3.2.1

    manuelf

      Hi *,

      seems to me that the deployment for sar-archives is broken in 3.2.1 (until/including 3.2.0 everything worked fine):
      My sar-archives contains an ejb-application (ejb.jar file) and some library jar-files. In the jboss-service.xml descriptor a few mbeans are started. These mbeans depend on the correct deployment of the ejb-jar. I didn't have to specify these dependencies, because until now the MBeans were correctly started after deployment of the ejb-far.

      Now the problems with 3.2.1:
      1. Mbeans are created before deployment of ejb-jar - this is bad because the classes needed vor these mbeans are also in this ejb-far
      2. After all even the ejb-jar doesn't get deployed correctly, because of missing datasource 'DefaultDS'. Looking at the logs it gets obvious: Deployment of all the database relevant stuff gets finished AFTER the deployment (EJBDeployer) of the ejb-jar file.

      My feeling is that ejb-jars nested in sar-archive are not handled like before - i.e. are deployed before other important stuff is running...

      So I have to switch back to 3.2.0 til this has been sorted out..

      Cheers,

      Manuel

        • 1. Re: Deployment broken in 3.2.1

          3.2.1 was mistakenly shipped with

          False

          It should be "True".

          Regards,
          Adrian

          • 2. Re: Deployment broken in 3.2.1

            Sorry this is in
            server/[config]/conf/jboss-service.xml

            Regards,
            Adrian

            • 3. Re: Deployment broken in 3.2.1
              manuelf

              Hi Adrian,

              tried it with your mentioned setting - but without success. 3.2.1 behaves definetly different than 3.2.0 and before.

              Can someone give me a hint how to package an application which consists of an ejb-app and some additional services, that depend on that ejb-app?

              My working (until now) packaging was an sar archive containing 1 ejb-jar and 2 normal jar files for the services. In the jboss-service.xml 2 MBeans were started - their class files were in the 2 normal jar files.
              After deployment jboss used to deploy the ejb-jar file first - the others second and started the service MBeans at the end.
              JBOSS 3.2.1 fails to do this: normal jar files are deployed first (seems that the EJBDeployer is not yet started at that point - so deployment of ejb-jar is on the waiting list) Creating of the mbeans comes next, but fails due to the fact that the ejb-jar is not deployed yet and the mbeans reference remote interfaces of ejbs which are in the ejb-jar. After that the now started EJBDeployer fails, because the referenced datasource is not registered in JNDI at that point....

              Really weired - the ordering in which services are coming up has obviously changed!

              Cheers,

              Manuel

              • 4. Re: Deployment broken in 3.2.1

                The recursive search should fix it?

                The problem is the EJB deployer depends on
                jms because of MDBs and JMS was moved to a
                sub folder.

                You can explicity make a dependency on an EJB
                for your MBean.

                Add the following to your MBean config.

                jboss.j2ee:service=EJB,jndiName=whatever

                Regards,
                Adrian

                • 5. Re: Deployment broken in 3.2.1
                  manuelf

                  Hi again Adrian and thanks for your passion ;p

                  Sorry about insisting on that point - but I had to totally change my packaging to make my application deployable under 3.2.1:

                  What I did (a bit dirty IMHO):
                  1. pack my ejb-jar and the library-jars containing the classes of my mbeans in a sar file.
                  2. declaring a dependency on the ejb-modul (setting fixed jmx-name via jboss.xml descriptor in the ejb-jar) for each mbean

                  this alone would not help because:
                  As mentioned in my previous postings the main deployer deploys sar-files BEFORE EJBDeployer is up (due to the fact that EJBDeployer depends on other services that get deployed after my sar because sar files have highest priority). OK - this means the library-jars nested in my sar get deployed first - then the mbeans declared in jboss-service.xml are created and there it crashes because this mbeans reference ejb-interfaces which are in the ejb-jar, that is still on the waiting list for deployment since the EJBDeployer is not up yet.
                  OK - to fix this...

                  3. Extract the classes referenced from the mbeans from the ejb-jar and put it in a standalone jar and put it in the sar (dont duplicate it - remove these classes from the ejb-jar or you would get linkage error due to duplicate classes)

                  OK - now the sar deploys almost correctly - but during deployment of the entity beans I got errors because the datasource wasn't yet bound to jndi....

                  4. I added an additional dependency for the EJBDeployer on my jca-service.

                  Now everything deploys correctly.

                  The downside of this approach is, that I have to extract the ejb-interfaces from my ejb-jar - thats awfull! the ejb-jar would never deploy alone!
                  The underlying problem seems to be, that sar files get deployed too early (before needed Deployers are up) and that dependency declaration in mbeans dont delay the creation but only the start of the mbean. if the creation would be delayed it wouldn't be necessary to extract the ejb-interfaces from my ejb-jar ...

                  So long,

                  Manuel

                  • 6. Re: Deployment broken in 3.2.1
                    manuelf

                    Hi again Adrian and thanks for your passion ;p

                    Sorry about insisting on that point - but I had to totally change my packaging to make my application deployable under 3.2.1:

                    What I did (a bit dirty IMHO):
                    1. pack my ejb-jar and the library-jars containing the classes of my mbeans in a sar file.
                    2. declaring a dependency on the ejb-modul (setting fixed jmx-name via jboss.xml descriptor in the ejb-jar) for each mbean

                    this alone would not help because:
                    As mentioned in my previous postings the main deployer deploys sar-files BEFORE EJBDeployer is up (due to the fact that EJBDeployer depends on other services that get deployed after my sar because sar files have highest priority). OK - this means the library-jars nested in my sar get deployed first - then the mbeans declared in jboss-service.xml are created and there it crashes because this mbeans reference ejb-interfaces which are in the ejb-jar, that is still on the waiting list for deployment since the EJBDeployer is not up yet.
                    OK - to fix this...

                    3. Extract the classes referenced from the mbeans from the ejb-jar and put it in a standalone jar and put it in the sar (dont duplicate it - remove these classes from the ejb-jar or you would get linkage error due to duplicate classes)

                    OK - now the sar deploys almost correctly - but during deployment of the entity beans I got errors because the datasource wasn't yet bound to jndi....

                    4. I added an additional dependency for the EJBDeployer on my jca-service.

                    Now everything deploys correctly.

                    The downside of this approach is, that I have to extract the ejb-interfaces from my ejb-jar - thats awfull! the ejb-jar would never deploy alone!
                    The underlying problem seems to be, that sar files get deployed too early (before needed Deployers are up) and that dependency declaration in mbeans dont delay the creation but only the start of the mbean. if the creation would be delayed it wouldn't be necessary to extract the ejb-interfaces from my ejb-jar ...

                    So long,

                    Manuel