Description of problem:
========================
- Expression is added in the datasource JNDI name attribute as below:
-----
<datasource jndi-name="${ds}" pool-name="ExampleDS" enabled="true" use-java-context="true">
-----
- Value for the expression is passed to the JBoss server during the JBoss startup as below:
-----
./standalone.sh -Dds=java:jboss/datasources/ExampleDS
-----
- In the server.log file below is the information regarding the datasource.
-----
INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [${ds}]
-----
- Test the datasource using the below command and here is the result:
----
[standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS:test-connection-in-pool()
{
"outcome" => "failed",
"failure-description" => "JBAS010440: failed to invoke operation: JBAS010442: failed to match pool. Check JndiName: java:/${ds}",
"rolled-back" => true
}
----
- Here is the information regarding the JNDI name attribute:
----
[standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS:read-resource-description(recursive=true)
{
"outcome" => "success",
"result" => {
:
"jndi-name" => {
"type" => STRING,
"description" => "Specifies the JNDI name for the datasource",
"expressions-allowed" => true,
"nillable" => false,
"access-type" => "read-write",
"storage" => "configuration",
"restart-required" => "no-services"
},
:
}
-----