I am using JBoss 5 and the system properties service to set some system properties my app (ear with war) needs. One of these is the name of the virtual host which is referenced in jboss-web.xml:
<jboss-web>
<context-root>/</context-root>
<virtual-host>${my.host.system.prop}</virtual-host>
...
<depends>jboss:type=Service,name=SystemProperties</depends>
</jboss-web>
Note the dependency on the SystemProperties service.
However on server startup my app loads before the system properties have been set. Redeploying by touching the ear sorts it out. Interestingly I can see from the log that the SystemProperties service does indeed load before my app is deployed.
Anyone have any ideas? I don't want to resort to setting the props in JAVA_OPTS if I can help it.