Wednesday, April 13, 2011

JBoss - using properties-service.xml to set environment variables

In every JBoss installation there will be a file called "properties-service.xml" in the deploy folder.  This file allows you to setup environment variables (rather then setting them at the JVM/System level) which all deployed applications can then use by calling the System.getProperty() method.  Just uncomment the section shown below to enable some global properties or use the URLList to point to external properties files:

[code language="xml"]
<!--
Set raw properties file style properties.
-->
<attribute name="Properties">
ATTRIBUTE_NAME_1=somevariable
ATTRIBUTE_NAME_1=anotherVariable
</attribute>
[/code]

No comments:

Post a Comment