如何使用aries事务jdbc包装XADataSource

时间:2018-10-03 09:30:05

标签: java osgi apache-karaf xa

我正在karaf 4.1.2中使用pax jdbc 1.1.0。

这是我的数据源文件(org.ops4j.datasource-application1.cfg)

osgi.jdbc.driver.name=mysql
pool=dbcp2
xa=true
jdbc.pool.testOnBorrow=true
jdbc.pool.blockWhenExhausted=true
jdbc.pool.maxWaitMillis=400
url=jdbc:mysql://ip:3306/application1?characterEncoding=UTF-8&autoReconnect=true&autoReconnectForPools=true
user=xxx
password=yyy
dataSourceName=application1

与jms-activemq结合使用时,出现以下错误

| ERROR | DefaultQuartzScheduler-com.application1.olm.Order-service-quartzCamelPublisher_Worker-5 | Transaction                      | 177 - org.apache.aries.transaction.manager - 1.3.3 | Please correct the integration and supply a NamedXAResource
java.lang.IllegalStateException: Cannot log transactions as com.mysql.jdbc.jdbc2.optional.JDBC4MysqlXAConnection@3df4d31d is not a NamedXAResource.
    at org.apache.geronimo.transaction.manager.TransactionImpl$TransactionBranch.getResourceName(TransactionImpl.java:781) [177:org.apache.aries.transaction.manager:1.3.3]

在这里建议“对于jdbc,您可以使用aries事务jdbc包装XADataSource。”,我该怎么做?

Why am I getting "is not a NamedXAResource" in Apache Karaf 4.0.4?

0 个答案:

没有答案