Cannot find PrefixDeploymentSorter for controlling deployment ordering in JBoss EAP
Environment
- JBoss Enterprise Application Platform (EAP)
- 5.0.0_GA
- 5.0.1
- 5.1.0
Issue
In JBoss.org 4.x we set the URLComparator attribute to 'org.jboss.deployment.scanner.PrefixDeploymentSorter' in the URLDeploymentScanner mbean to control the deployment ordering. But, the PrefixDeploymentSorter does not appear available any longer.
Resolution
EAP 5.1.x
The PrefixDeploymentSorter is already enabled in <jboss-home>/server/<server-dir>/conf/bootstrap/deployer.xml
EAP 5.0.1
The PrefixDeploymentSorter was not included in EAP 5.0.0_GA. However, introduction of the functionality through the LegacyPrefixDeploymentContextComparator is included in EAP 5.0.1.
To use the LegacyPrefixDeploymentContextComparator modify the <jboss-home>/server/<server-dir>/conf/bootstrap/deployers.xml and set the LegacyPrefixDeploymentContextComparator as the topContextComparator bean:
<bean name="topContextComparator">
<constructor factoryClass="org.jboss.system.deployers.LegacyPrefixDeploymentContextComparator" factoryMethod="getInstance"/>
</bean>
There is a bug in the LegacyDeploymentContextComparator on which the LegacyPrefixDeploymentContextComparator is a subclass. This bug is corrected in EAP 5.1. But, for EAP 5.0.1, you will need to either define a LegacyDeploymentContextComparator bean:
<bean name="legacyContextComparator">
<constructor factoryClass="org.jboss.system.deployers.LegacyDeploymentContextComparator" factoryMethod="getInstance"/>
</bean>
or configure the use of the LegacyPrefixDeploymentContextComparator in the <jboss-home>/server/<server-dir>/deployers/ear-deployer-jboss-beans.xml for the EARStructureDeployer's comparatorClassName property:
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<bean name="EARStructureDeployer" class="org.jboss.deployment.EARStructure">
<property
name="comparatorClassName">org.jboss.system.deployers.LegacyPrefixDeploymentContextComparator</property>
...
EAP 5.0.0
The PrefixDeploymentSorter is not included
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
