1 2 3 Previous Next 36 Replies Latest reply on Feb 10, 2009 5:40 AM by jaikiran

    JBoss AS 5 CR1 deployment sorting

    zithuba

      How does the deployment sorter for JBossAS5 works? I deployed a -ds.xml and an ear file, the ear file deployed first, instead of the -ds.xml file.

        • 1. Re: JBoss AS 5 CR1 deployment sorting
          baz

          I do have the same problem posted here:
          http://www.jboss.com/index.html?module=bb&op=viewtopic&t=138584

          My project was a war, not an ear. So the behaviour is independed of ear or war

          • 2. Re: JBoss AS 5 CR1 deployment sorting
            jaikiran

             

            "zithuba" wrote:

            How does the deployment sorter for JBossAS5 works?


            I have seen users asking about the deployment ordering in CR1. I haven't yet found the documentation related to this. I will continue looking for the docs, but i too would be interested in knowing about this.

            "zithuba" wrote:
            I deployed a -ds.xml and an ear file, the ear file deployed first, instead of the -ds.xml file.


            Can you post a bit more details about your EAR application? What does it contain and how is it using the datasource file? Can you post the console logs when the deployment starts and also any exception that you see.

            I have EAR - datasource dependency working in my application on CR1. My EAR consists of a persistence-unit which relies on the datasource. The EAR also consists of EJB3 beans which rely on the persistence-unit. The datasource -ds.xml and the EAR are both placed in the deploy folder of JBoss and i do see that the dependency is honoured. My beans are triggered to start after the datasource has been bound.


            • 3. Re: JBoss AS 5 CR1 deployment sorting
              alesj

               

              "zithuba" wrote:
              How does the deployment sorter for JBossAS5 works? I deployed a -ds.xml and an ear file, the ear file deployed first, instead of the -ds.xml file.

              This should work, since we had similar problems with deploying Seam apps, but we fixed it by adding legacy ordering.
              See deployers.xml in conf directory.

               <!-- use legacy ordering -->
               <bean name="topContextComparator">
               <constructor factoryClass="org.jboss.system.deployers.LegacyDeploymentContextComparator" factoryMethod="getInstance"/>
               </bean>
              
               <!-- The MainDeployer -->
               <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
               <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
               <property name="deployers"><inject bean="Deployers"/></property>
               <property name="mgtDeploymentCreator"><inject bean="ManagedDeploymentCreator"/></property>
               <property name="comparator"><inject bean="topContextComparator"/></property>
               </bean>
              


              • 4. Re: JBoss AS 5 CR1 deployment sorting
                zithuba

                I have an ear file that look like this:
                Ear:
                wits-wims-batch.jar
                wits-wims-org-import.jar
                lib:
                wits-idb.jar
                META-INF:
                application.xml
                jboss-app.xml

                The wits-wims-batch.jar contains the persistence.xml file. I am using Spring framework and Spring batch framework. I reference the EntityManagerFactory using jee:jndi namespace to be the bean managed by Spring.

                This is the exception for the bean reference:
                org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myEmf': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: JobHistoryFactory not bound

                After this error the Spring framework shuts down, then this gets printed:

                2008-07-04 10:06:35,145 DEBUG [org.jboss.system.ServiceConfigurator] (main) JndiName set to JobHistoryDS in jboss.jca:service=LocalTxCM,name=JobHistoryDS
                2008-07-04 10:06:35,145 DEBUG [org.jboss.system.ServiceConfigurator] (main) SubjectFactory set to org.jboss.security.integration.JBossSecuritySubjectFactory@f46a4 in jboss.jca:service=LocalTxCM,name=JobHistoryDS
                2008-07-04 10:06:35,145 DEBUG [org.jboss.system.ServiceConfigurator] (main) CachedConnectionManager set to jboss.jca:service=CachedConnectionManager in jboss.jca:service=LocalTxCM,name=JobHistoryDS
                2008-07-04 10:06:35,145 DEBUG [org.jboss.system.ServiceConfigurator] (main) JaasSecurityManagerService set to jboss.security:service=JaasSecurityManager in jboss.jca:service=LocalTxCM,name=JobHistoryDS
                2008-07-04 10:06:35,145 DEBUG [org.jboss.system.ServiceConfigurator] (main) ManagedConnectionPool set to jboss.jca:service=ManagedConnectionPool,name=JobHistoryDS in jboss.jca:service=LocalTxCM,name=JobHistoryDS
                2008-07-04 10:06:35,145 DEBUG [org.jboss.system.ServiceConfigurator] (main) TransactionManagerService set to jboss:service=TransactionManager in jboss.jca:service=LocalTxCM,name=JobHistoryDS
                2008-07-04 10:06:35,145 DEBUG [org.jboss.system.ServiceConfigurator] (main) LocalTransactions set to true in jboss.jca:service=LocalTxCM,name=JobHistoryDS
                2008-07-04 10:06:35,145 DEBUG [org.jboss.system.ServiceConfigurator] (main) TrackConnectionByTx set to true in jboss.jca:service=LocalTxCM,name=JobHistoryDS

                If I let the server start and then later deploy the ear, everything is fine.

                • 5. Re: JBoss AS 5 CR1 deployment sorting
                  zithuba

                   

                  "alesj" wrote:
                  This should work, since we had similar problems with deploying Seam apps, but we fixed it by adding legacy ordering.
                  See deployers.xml in conf directory.


                  My deployers.xml uses this by default. I went to see if I can change and found that it is like that, and then look at the source code of the comparator which creates the legacyorder map.

                  • 6. Re: JBoss AS 5 CR1 deployment sorting
                    alesj

                    Looks like something is delaying DS to be fully installed.
                    Could be TM, since it was moved from conf/jboss-service.xml into deploy/transaction-service.xml.
                    If you can make that DS lazy (using some Spring lazy mechanism), you should probably be fine.

                    But this will always be an issue w/o explicit dependencies.
                    MC is as smart in ordering things as the explicit dependencies go. ;-)

                    • 7. Re: JBoss AS 5 CR1 deployment sorting
                      baz

                      ear does work for me, but not war

                      • 8. Re: JBoss AS 5 CR1 deployment sorting
                        alesj

                         

                        "baz" wrote:
                        ear does work for me, but not war

                        What exactly doesn't work?

                        If you deploy -ds.xml and war separately, it should work.
                        Since the same order logic applies.

                        But (looking at your other post) I think it's the same issue - no explicit dependency in war on DS, hence TM delaying DS, and war starts before DS.

                        • 9. Re: JBoss AS 5 CR1 deployment sorting
                          alesj

                           

                          "alesj" wrote:
                          But (looking at your other post) I think it's the same issue - no explicit dependency in war on DS, hence TM delaying DS, and war starts before DS.

                          Hmmm, looking at the legacy order:
                           legacyOrder.put(".deployer", 50);
                           legacyOrder.put("-deployer.xml", 50);
                           legacyOrder.put(".aop", 100);
                           legacyOrder.put("-aop.xml", 100);
                           legacyOrder.put(".sar", 150);
                           legacyOrder.put("-service.xml", 150);
                           legacyOrder.put(".beans", 200);
                           legacyOrder.put(".rar", 250);
                           legacyOrder.put("-ds.xml", 300);
                           legacyOrder.put(".har", 350);
                           legacyOrder.put(".jar", 400);
                           legacyOrder.put(".ejb3", 400);
                           legacyOrder.put(".par", 400);
                           legacyOrder.put(".war", 500);
                           legacyOrder.put(".wsr", 600);
                           legacyOrder.put(".ear", 650);
                           legacyOrder.put(".jar", 700);
                           legacyOrder.put(".zip", 750);
                           legacyOrder.put(".bsh", 800);
                           legacyOrder.put(".last", 900);
                          

                          TM should be kicking in first.
                          Then DS, hence dependency on TM resolved.
                          And only then war.


                          • 10. Re: JBoss AS 5 CR1 deployment sorting
                            jaikiran

                            Let us know if you want the logs and a sample deployment which shows this issue with WAR files.

                            • 11. Re: JBoss AS 5 CR1 deployment sorting
                              alesj

                               

                              "jaikiran" wrote:
                              Let us know if you want the logs and a sample deployment which shows this issue with WAR files.

                              Sure, open up a JIRA in JBAS space, attach the test case (failing deployment) and assign it to me.
                              I'll have a look, np.

                              • 12. Re: JBoss AS 5 CR1 deployment sorting
                                baz

                                What does this mean to my JBT generated project. Is it nessecary that the JBoss Tools developers change something in the generation of the project.
                                Or should it work out of the box, as it is now. If this is the case, what could be the reason it is not working.

                                • 13. Re: JBoss AS 5 CR1 deployment sorting
                                  alesj

                                   

                                  "baz" wrote:
                                  What does this mean to my JBT generated project. Is it nessecary that the JBoss Tools developers change something in the generation of the project.

                                  That's for JBT people to answer.
                                  "baz" wrote:

                                  Or should it work out of the box, as it is now. If this is the case, what could be the reason it is not working.

                                  That's what we're trying to discover - see my previous post. ;-)

                                  • 14. Re: JBoss AS 5 CR1 deployment sorting
                                    jaikiran

                                     

                                    "alesj" wrote:

                                    Sure, open up a JIRA in JBAS space, attach the test case (failing deployment) and assign it to me.
                                    I'll have a look, np.


                                    Done. http://jira.jboss.com/jira/browse/JBAS-5719

                                    If any additional information is required, do let us know.

                                    1 2 3 Previous Next