How to create xa-datasource using jboss-as-maven-plugin?
Issue
When trying to create xa-datasource using jboss-as-maven-plugin as described in the documentation examples 1, the process ends with the following error.
JBAS010469: At least one xa-datasource-property is required for an xa-datasource
Corresponding pom.xml section:
<execution>
<id>add-datasource</id>
<phase>install</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<address>subsystem=datasources</address>
<resources>
<resource>
<address>xa-data-source=java:jboss/datasources/postgresDS</address>
<enable-resource>true</enable-resource>
<properties>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<jndi-name>java:jboss/datasources/postgresDS</jndi-name>
<enabled>true</enabled>
<pool-name>myPool</pool-name>
<driver-name>postgresql.jar</driver-name>
</properties>
</resource>
<resource>
<address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=DatabaseName</address>
<properties>
<value>myDatabase</value>
</properties>
</resource>
<resource>
<address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=ServerName</address>
<properties>
<value>localhost</value>
</properties>
</resource>
<resource>
<address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=User</address>
<properties>
<value>dbuser</value>
</properties>
</resource>
<resource>
<address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=Password</address>
<properties>
<value>supersecret</value>
</properties>
</resource>
</resources>
</configuration>
</execution>
Environment
- jboss-as-maven-plugin 7.3
- JBoss Enterprise Application Platform 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.