ShardingSphere抛出:Fatal error occurred in the transaction branch - check your data for consistency

Shardingphere-Proxy启动时,发现输出以下错误


```powershell
[WARN ] 16:47:21.181 [main] c.a.r.xa.XaResourceRecoveryManager - Error while retrieving xids from resource - will retry later...
com.mysql.cj.jdbc.MysqlXAException: XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency
	at com.mysql.cj.jdbc.MysqlXAConnection.mapXAExceptionFromSQLException(MysqlXAConnection.java:344)
	at com.mysql.cj.jdbc.MysqlXAConnection.recover(MysqlXAConnection.java:189)
	at com.mysql.cj.jdbc.MysqlXAConnection.recover(MysqlXAConnection.java:117)
	at com.atomikos.datasource.xa.RecoveryScan.recoverXids(RecoveryScan.java:32)
	at com.atomikos.recovery.xa.XaResourceRecoveryManager.retrievePreparedXidsFromXaResource(XaResourceRecoveryManager.java:158)
	at com.atomikos.recovery.xa.XaResourceRecoveryManager.recover(XaResourceRecoveryManager.java:67)
	at com.atomikos.datasource.xa.XATransactionalResource.recover(XATransactionalResource.java:449)
	at com.atomikos.datasource.xa.XATransactionalResource.setRecoveryService(XATransactionalResource.java:416)
	at com.atomikos.icatch.config.Configuration.notifyAfterInit(Configuration.java:466)
	at com.atomikos.icatch.config.Configuration.init(Configuration.java:450)
	at com.atomikos.icatch.config.UserTransactionServiceImp.initialize(UserTransactionServiceImp.java:105)
	at com.atomikos.icatch.config.UserTransactionServiceImp.init(UserTransactionServiceImp.java:219)
	at org.apache.shardingsphere.transaction.xa.atomikos.manager.AtomikosTransactionManager.init(AtomikosTransactionManager.java:41)
	at org.apache.shardingsphere.transaction.xa.XAShardingTransactionManager.init(XAShardingTransactionManager.java:52)
	at org.apache.shardingsphere.transaction.ShardingTransactionManagerEngine.init(ShardingTransactionManagerEngine.java:67)
	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.(JDBCBackendDataSource.java:63)
	at org.apache.shardingsphere.shardingproxy.backend.schema.LogicSchema.(LogicSchema.java:54)
	at org.apache.shardingsphere.shardingproxy.backend.schema.impl.ShardingSchema.(ShardingSchema.java:77)
	at org.apache.shardingsphere.shardingproxy.backend.schema.LogicSchemaFactory.newInstance(LogicSchemaFactory.java:56)
	at org.apache.shardingsphere.shardingproxy.backend.schema.LogicSchemas.initSchemas(LogicSchemas.java:102)
	at org.apache.shardingsphere.shardingproxy.backend.schema.LogicSchemas.init(LogicSchemas.java:91)
	at org.apache.shardingsphere.shardingproxy.backend.schema.LogicSchemas.init(LogicSchemas.java:75)
	at org.apache.shardingsphere.shardingproxy.Bootstrap.startWithoutRegistryCenter(Bootstrap.java:123)
	at org.apache.shardingsphere.shardingproxy.Bootstrap.main(Bootstrap.java:85)
Caused by: java.sql.SQLException: XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1200)
	at com.mysql.cj.jdbc.MysqlXAConnection.recover(MysqlXAConnection.java:168)
	... 22 common frames omitted

这个错误原因其实很简单。就算官网给出的jar包不对。
Shardingphere官网给的是5.1.4版本,而目前最新是8.0版本啦。
可以下载我这个资源(CSDN不人性化,不让我传。。。)
或者去github上自己下载
https://mvnrepository.com/artifact/mysql

你可能感兴趣的:(ShardingSphere抛出:Fatal error occurred in the transaction branch - check your data for consistency)