Is there a configuration option for JBoss 5.0 to control how the ears are deployed?

Is there a mechanism inside the ear file itself (jboss-app.xml) or the configuration on the server to ensure that the EAR is loaded last and / or after the other ear? for instance

  • /deploy/web-services.ear(owned by another vendor / project)
  • /deploy/enterprise-app.ear (war, ejbs web services)

sort of:

<load-precedence> web-services.ear enterprise-app.ear </load-precedence> 
+4
source share
3 answers

It would be convenient if it were; I do not know one thing. We have EARs that depend on other EARs. Our startup code runs in the thread and retries at intervals until the EJB in another EAR is available.

+3
source

I never used JBoss as an application server, but looked at this documentation:

JBOSS DeploymentScanner

There is a Deployment Sorter, which seems to be what you are looking for.

+2
source

I am using the EAR suffix setting order in conf/bootstrap/deployers.xml . The value ranges from 50 (started first) and 950 (last started), see the LegacyDeploymentContextComparator class . In your case, you will receive:

 <bean name="topContextComparator"> <constructor factoryClass="org.jboss.system.deployers.LegacyDeploymentContextComparator" factoryMethod="getInstance"/> <property name="suffixOrder" class="java.util.Map"> <map keyClass="java.lang.String" valueClass="java.lang.Integer"> <entry> <key>web-services.ear</key> <value>500</value> </entry> <entry> <key>enterprise-app.ear</key> <value>600</value> </entry> </map> </property> </bean> 

I also use a common suffix configuration such as _<N>.ear , where <N> is the initial order. This avoids changing the deployers.xml file each time a new EAR is deployed. This is useful when deploying versions of MyEar_v20130611_3.ear such as MyEar_v20130611_3.ear (in this case N = 3):

  <entry> <key>_1.ear</key> <value>500</value> </entry> <entry> <key>_2.ear</key> <value>600</value> </entry> <entry> <key>_3.ear</key> <value>700</value> </entry> 
+1
source

All Articles