看起来您必须将数据源配置为 XA。这里有一个例子
<datasources>
<xa-datasource>
<jndi-name>jdbc/my_ds</jndi-name>
<xa-datasource-property name="URL">jdbc:mysql://localhost:3306/my_db</xa-datasource-property>
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
<user-name>root</user-name>
<password>password</password>
<track-connection-by-tx>true</track-connection-by-tx>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-chec ker-class-name>
<min-pool-size>1</min-pool-size>
<max-pool-size>10</max-pool-size>
<idle-timeout-minutes>10</idle-timeout-minutes>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</xa-datasource>