PingWang201209 opened a new issue, #19790:
URL: https://github.com/apache/shardingsphere/issues/19790
### Which version of ShardingSphere did you use?
5.1.2
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
### Expected behavior
atomikos works well under 5.1.2. because it is normal in 5.0.0
### Actual behavior
Caused by: java.lang.AbstractMethodError:
com.atomikos.icatch.jta.JtaTransactionServicePlugin.beforeInit()V
at
com.atomikos.icatch.config.Configuration.notifyBeforeInit(Configuration.java:417)
at com.atomikos.icatch.config.Configuration.init(Configuration.java:389)
at
com.atomikos.icatch.config.UserTransactionServiceImp.initialize(UserTransactionServiceImp.java:100)
at
com.atomikos.icatch.config.UserTransactionServiceImp.init(UserTransactionServiceImp.java:189)
at
org.apache.shardingsphere.transaction.xa.atomikos.manager.AtomikosTransactionManagerProvider.init
(AtomikosTransactionManagerProvider.java:46)
at
org.apache.shardingsphere.transaction.xa.XAShardingSphereTransactionManager.init
(XAShardingSphereTransactionManager.java:56)
at
org.apache.shardingsphere.transaction.ShardingSphereTransactionManagerEngine.lambda$init$0
(ShardingSphereTransactionManagerEngine.java:67)
at java.util.Map.forEach(Map.java:630)
at
org.apache.shardingsphere.transaction.ShardingSphereTransactionManagerEngine.init
(ShardingSphereTransactionManagerEngine.java:67)
at
org.apache.shardingsphere.transaction.context.TransactionContextsBuilder.build(TransactionContextsBuilder.java:54)
at
org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder.createContextManager
(ClusterContextManagerBuilder.java:154)
at
org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder.build
(ClusterContextManagerBuilder.java:76)
### Reason analyze (If you can)
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
spring boot startup error
### Example codes for reproduce this issue (such as a github link).
<!-- spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!-- jdbc -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-cluster-mode-repository-etcd</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
@Slf4j
@Configuration
public class DataSourceConfiguration {
@Bean
public DataSource dataSource() {
try (InputStream inputStream =
getClass().getClassLoader().getResourceAsStream("META-INF/shardingsphere.yaml"))
{
byte[] buffer = IoUtil.readBytes(inputStream);
return
YamlShardingSphereDataSourceFactory.createDataSource(buffer);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new SysException(e.getMessage(), e);
}
}
}
@Configuration
@EnableTransactionManagement
public class TransactionConfiguration {
@Bean
public PlatformTransactionManager txManager(final DataSource dataSource)
{
return new DataSourceTransactionManager(dataSource);
}
@Bean
public JdbcTemplate jdbcTemplate(final DataSource dataSource) {
return new JdbcTemplate(dataSource);
}
}
# META-INF/shardingsphere.yaml
schemaName: logic_db
mode:
type: Cluster
repository:
type: Etcd
props:
namespace: governance_ds
server-lists: http://localhost:52379
timeToLiveSeconds: 30
connectionTimeout: 30
overwrite: false
props:
sql-show: true
sql-simple: false
max-connections-size-per-query: 10
check-table-metadata-enabled: true
check-duplicate-table-enabled: true
sql-federation-enabled: false
dataSources:
spa_identity:
dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
url:
jdbc:mysql://localhost:3306/spa_identity?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false&useInformationSchema=false&allowPublicKeyRetrieval=true
username: root
password: root
max-active: 999
initial-size: 1
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: select 'x'
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-open-prepared-statements: 20
connection-properties:
druid.stat.merggSql=ture;druid.stat.slowSqlMillis=5000
rules:
- !ENCRYPT
tables:
client_console:
columns:
secret:
cipherColumn: secret
encryptorName: secret-encryptor
encryptors:
secret-encryptor:
type: AES
props:
aes-key-value: 666666
queryWithCipherColumn: true
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]