8 Replies Latest reply on May 27, 2010 5:07 AM by m.wigge

    PrefixDeploymentSorter in Jboss 5


      How should I set the URLComparator to PrefixDeploymentSorter in JBoss5 beta 2?

      Thanks

      James

        • 1. Re: PrefixDeploymentSorter in Jboss 5
          fredmaster


          Somebody can reply this post ?

          Tanks,

          Fred

          • 2. Re: PrefixDeploymentSorter in Jboss 5
            dastraub

            The PrefixDeploymentSorter pops up again in JBoss 6 (https://jira.jboss.org/jira/browse/JBAS-7614).

            I used this cass with JBoss 5 (added to lib/jboss-system.jar and modified conf/bootstrap/deployers.xml).

            • 3. Re: PrefixDeploymentSorter in Jboss 5
              mikefinkenzeller

              What exactly did you change in the deployers.xml file? I copied the class into the jboss-system.jar file and change the class in the deployers.xml file but am getting a NullPointerException on deployment.

              • 4. Re: PrefixDeploymentSorter in Jboss 5
                jaikiran

                I guess, he changed this:

                <!-- use legacy ordering -->
                   <bean name="topContextComparator">
                     <constructor factoryClass="org.jboss.system.deployers.LegacyDeploymentContextComparator" factoryMethod="getInstance"/>
                   </bean>
                

                 

                to

                 

                <!-- use legacy ordering -->
                   <bean name="topContextComparator">
                     <constructor factoryClass="org.jboss.system.deployers.LegacyPrefixDeploymentContextComparator" factoryMethod="getInstance"/>
                   </bean>
                
                
                
                • 5. Re: PrefixDeploymentSorter in Jboss 5
                  dastraub

                  Yes, that's my change. I don't get an NPE with this change, but I tested only a little deployment which I use in a class.

                  • 6. Re: PrefixDeploymentSorter in Jboss 5
                    dastraub

                    Now I get the same NPE if I deploy an EAR with some JAR's. I described this also in the https://jira.jboss.org/jira/browse/JBAS-7614.

                     

                    If we change the bootstrap/deployers.xml in this way, the singelton instance of the LegacyDeploymentContextComparator doesn't exist (

                    who is used inside of a EAR).

                    In this case the AbstractStructureBuilder creates an new instance for the current deployment, but this instance of LegacyDeploymentContextComparator isn't initialized. This wil happen only during an lifecycle-callback ("create").

                     

                    To fix this, I added also the LegacyDeploymentContextComparator in the bootstrap/deployers.xml :

                     

                      <!-- use legacy ordering -->
                       <bean name="topContextComparator">
                         <constructor factoryClass="org.jboss.system.deployers.LegacyPrefixDeploymentContextComparator" factoryMethod="getInstance"/>
                       </bean>

                     

                       <bean name="otherContextComparator">
                         <constructor factoryClass="org.jboss.system.deployers.LegacyDeploymentContextComparator" factoryMethod="getInstance"/>
                       </bean>

                     

                    in this case the singelton of the LegacyDeploymentContextComparator is created and used by nested deployments.

                    • 7. Re: PrefixDeploymentSorter in Jboss 5
                      mikefinkenzeller

                      Thanks for getting back to me on this. I will give that a try.

                      • 8. Re: PrefixDeploymentSorter in Jboss 5
                        m.wigge

                        I compiled a LegacyPrefixDeploymentContextComparator.class and put it into jboss-system.jar. After I've updated my deployers.xml I got this Exception:

                         

                        2010-05-26 12:35:08,427 ERROR [org.jboss.system.server.profileservice.ProfileServiceBootstrap] Failed to load profile:
                        java.lang.IllegalStateException: Deployers are shutdown
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.checkShutdown(DeployersImpl.java:187)
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:778)
                                at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
                                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
                                at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
                                at org.jboss.Main.boot(Main.java:209)
                                at org.jboss.Main$1.run(Main.java:547)
                                at java.lang.Thread.run(Thread.java:619)

                         

                        Any ideas?

                         

                        Could anyone upload a working jboss-system.jar (with LegacyPrefixDeploymentContextComparator) to check if i made a misstake?

                         

                        Thanks in advance

                         

                        EDIT:

                        Found a misstake in my deployers.xml 

                        It seems to work!