I am creating a common standalone-full.xml for all server environments and therefore should have variables for the database URL (and such) instead of hard coding them.
One such section in the configuration file might look like this:
<datasource jta="true" jndi-name="java:/somename" pool-name="somename" enabled="true" use-ccm="false"> <connection-url>jdbc:mysql://${SOMENAME_DB_URL}</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <driver>mysql</driver> <pool> <min-pool-size>5</min-pool-size> <max-pool-size>15</max-pool-size> </pool> <security> <user-name>${DB_USERNAME}</user-name> <password>${DB_PASSWORD}</password> </security> <validation> <validate-on-match>false</validate-on-match> <background-validation>false</background-validation> </validation> <statement> <share-prepared-statements>false</share-prepared-statements> </statement> </datasource>
However, when starting the server with this configuration file, it simply throws an "Unable to resolve expression" error for all such sections.
I tried to put the variables in /etc/environment as well as in the .jbossclirc file in /bin using set DB_USERNAME=mydbusername , but to no avail.
As you can see, I shudder a little from the dark, as I could not find the correct documentation on how to do this. I'm not even sure if this is really possible. Any help is appreciated.
source share