JBoss EAP 7-7.3 environment variables: standalone vs. domain

  docker, jboss, jboss-eap-6, jboss-eap-7, wildfly

How to use env variables for datasource properties in JBOSS EAP 7.3? It does not work on my local machine and in docker also.

Here is datasource part of my standalone-full.xml file

<datasource jta="true" jndi-name="java:/jdbc/powds" pool-name="powpu" enabled="true" use-java-context="true" use-ccm="true">
                        <connection-url>jdbc:oracle:thin:@${env.CONNECTION_URL}:ddjboss</connection-url>
                        <driver>oracle</driver>
                        <pool>
                            <min-pool-size>1</min-pool-size>
                            <max-pool-size>15</max-pool-size>
                            <prefill>true</prefill>
                            <use-strict-min>false</use-strict-min>
                            <flush-strategy>FailingConnectionOnly</flush-strategy>
                            <allow-multiple-users>false</allow-multiple-users>
                        </pool>
                        <security>
                            <user-name>${env.ORACLE_USERNAME}</user-name>
                            <password>${env.ORACLE_PASSWORD}</password>
                        </security>
                    </datasource>

How I set env variable in docker:

ENV CONNECTION_URL=lovalhost:9909

Source: Docker Questions

LEAVE A COMMENT