When expression is used in jndi name attribute of datasource then
test-connection-in-pool operation is not working
-------------------------------------------------------------------------------------------------------------------
Key: WFLY-4801
URL:
https://issues.jboss.org/browse/WFLY-4801
Project: WildFly
Issue Type: Bug
Components: JCA
Affects Versions: 10.0.0.Alpha3
Reporter: Chao Wang
Assignee: Chao Wang
Fix For: 9.0.0.Final, 10.0.0.Alpha4
{noformat}
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"
},
:
}
-----
{noformat}