Yeah, there's a couple of things going on, perhaps a huge bug, or a change in APIs that has been completely undocumented. I've used your suggestions to update the maven plugin with correct elements. While the xml in the configuration gets updated, it doesn't seem that the underlying engine is picking up those changes.
NOTE: This is for xa-datasources only.
Using the execution in my pom as follows:
<execution>
<id>add-xa-datasource</id>
<!-- Don't use install, if they haven't fixed it on the site, the app will deploy before this is called! -->
<phase>package</phase>
<configuration>
<address>subsystem=datasources</address>
<resources>
<resource>
<address>xa-data-source=java:jboss/datasources/myDS</address>
<enableResource>true</enableResource>
<properties>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<jndi-name>java:jboss/datasources/myDS</jndi-name>
<enabled>true</enabled>
<pool-name>myPool</pool-name>
<driver-name>postgresql</driver-name>
</properties>
<resources>
<resource>
<address>xa-datasource-properties=DatabaseName</address>
<properties>
<value>mydb</value>
</properties>
</resource>
<resource>
<address>xa-datasource-properties=ServerName</address>
<properties>
<value>localhost</value>
</properties>
</resource>
<resource>
<address>xa-datasource-properties=User</address>
<properties>
<value>test</value>
</properties>
</resource>
<resource>
<address>xa-datasource-properties=Password</address>
<properties>
<value>test</value>
</properties>
</resource>
<resource>
<address>xa-datasource-properties=PortNumber</address>
<properties>
<value>5433</value>
</properties>
</resource>
</resources>
</resource>
</resources>
</configuration>
<goals>
<goal>add-resource</goal>
</goals>
</execution>
Going to the CLI, the node reports:
[standalone@localhost:9999 /] /subsystem=datasources/xa-data-source=java\:jboss\/datasources\/myDS/:read-resource {
"outcome" => "success",
"result" => {
"allocation-retry" => undefined,
"allocation-retry-wait-millis" => undefined,
"background-validation" => undefined,
"background-validation-millis" => undefined,
"blocking-timeout-wait-millis" => undefined,
"check-valid-connection-sql" => undefined,
"driver-name" => "postgresql",
"enabled" => true,
"exception-sorter-class-name" => undefined,
"exception-sorter-properties" => undefined,
"flush-strategy" => undefined,
"idle-timeout-minutes" => undefined,
"interleaving" => "false",
"jndi-name" => "java:jboss/datasources/myDS",
"jta" => "true",
"max-pool-size" => undefined,
"min-pool-size" => undefined,
"new-connection-sql" => undefined,
"no-recovery" => undefined,
"no-tx-separate-pool" => "false",
"pad-xid" => "false",
"password" => undefined,
"pool-prefill" => undefined,
"pool-use-strict-min" => undefined,
"prepared-statements-cache-size" => undefined,
"query-timeout" => undefined,
"reauth-plugin-class-name" => undefined,
"reauth-plugin-properties" => undefined,
"recovery-password" => undefined,
"recovery-plugin-class-name" => undefined,
"recovery-plugin-properties" => undefined,
"recovery-security-domain" => undefined,
"recovery-username" => undefined,
"same-rm-override" => undefined,
"security-domain" => undefined,
"set-tx-query-timeout" => "false",
"share-prepared-statements" => "false",
"spy" => "false",
"stale-connection-checker-class-name" => undefined,
"stale-connection-checker-properties" => undefined,
"track-statements" => "\"NOWARN\"",
"transaction-isolation" => undefined,
"url-delimiter" => undefined,
"url-selector-strategy-class-name" => undefined,
"use-ccm" => "true",
"use-fast-fail" => "false",
"use-java-context" => "true",
"use-try-lock" => undefined,
"user-name" => undefined,
"valid-connection-checker-class-name" => undefined,
"valid-connection-checker-properties" => undefined,
"validate-on-match" => "false",
"wrap-xa-resource" => "true",
"xa-datasource-class" => "org.postgresql.xa.PGXADataSource",
"xa-resource-timeout" => undefined,
"statistics" => {
"pool" => undefined,
"jdbc" => undefined
},
"xa-datasource-properties" => {
"User" => undefined,
"DatabaseName" => undefined,
"Password" => undefined,
"PortNumber" => undefined,
"ServerName" => undefined
}
}
}
It looks like the datasource properties that the node will need to connect aren't being parsed/read. Using test-connection-in-pool returns failure. I verified that the db was up and running, listening to the port, and that I could connect to it via other clients.
I tried adding the xa-datasource via the CLI, coding a minimal set by hand:
[standalone@localhost:9999 /] /subsystem=datasources/xa-data-source="java:jboss/datasources/myDS":add(jndi-name="java:jboss/datasources/myDS",xa-datasource-properties = {"ServerName"=>"localhost","DatabaseName"=>"mydb","PortNumber"=>"5433","User"=>"test","Password"=>"test"},driver-name="postgresql")
'xa-datasource-properties' is not found among the supported properties: [xa-datasource-class, jndi-name, driver-name, new-connection-sql, url-delimiter, url-selector-strategy-class-name, use-java-context, max-pool-size, min-pool-size, pool-prefill, pool-use-strict-min, interleaving, no-tx-separate-pool, pad-xid, same-rm-override, wrap-xa-resource, user-name, password, security-domain, reauth-plugin-class-name, reauth-plugin-properties, flush-strategy, prepared-statements-cache-size, share-prepared-statements, track-statements, allocation-retry, allocation-retry-wait-millis, blocking-timeout-wait-millis, idle-timeout-minutes, query-timeout, use-try-lock, set-tx-query-timeout, transaction-isolation, check-valid-connection-sql, exception-sorter-class-name, exception-sorter-properties, stale-connection-checker-class-name, stale-connection-checker-properties, valid-connection-checker-class-name, valid-connection-checker-properties, background-validation-millis, background-validation, use-fast-fail, validate-on-match, xa-resource-timeout, spy, use-ccm, recovery-username, recovery-password, recovery-security-domain, recovery-plugin-class-name, recovery-plugin-properties, no-recovery, jta]
xa-datasource-properties not supported. I even tried to change the name, to reflect that used by a blog post a few months back, to xa-data-source-properties. Same result. If XA connection information is no longer to be stored as xa-datasource-properties (as the maven plugin attempts to use), then how are we supposed to handle the information? I see a "user-name" and "password" properties, but nothing that looks like it should handle server name or port number, or database name (new-connection-sql -- but that seems like what might be used to test the connection)... Also note that "pool-name" and "enabled" are not accepted as properties for xa-datasource, but are used by the maven plugin.