IllegalStateException to run test-connection-in-pool() for datasource
with same jndi-name as previous failed datasource
-----------------------------------------------------------------------------------------------------------------------
Key: WFLY-7213
URL:
https://issues.jboss.org/browse/WFLY-7213
Project: WildFly
Issue Type: Bug
Reporter: Lin Gao
Assignee: Jesper Pedersen
If a DataSource was failed to be added, like adding a DataSource using
{{datasource-class}} without specifying any {{connection-properties}}:
{code:}
/subsystem=datasources/data-source=XXX:add(jndi-name=java:/XXX,
datasource-class=XXX,driver-name=h2)
{code}
or adding a DataSource using {{driver-class}} without specifying {{connection-url}}:
{code:}
/subsystem=datasources/data-source=XXX:add(jndi-name=java:/XXX, driver-name=h2)
{code}
It can be corrected afterwards by specifying correct information with same {{jndi-name}},
like:
{code:}
/subsystem=datasources/data-source=XXX:add(jndi-name=java:/XXX,
driver-name=h2,connection-url="jdbc:h2:xxx")
{code}
after the DataSource created, the {{test-connection-in-pool()}} operation will fail with
{{IllegalStateException}}
{code:}
/subsystem=datasources/data-source=XXX:test-connection-in-pool()
{code}