Closed Astierred closed 2 years ago
@SFlora Hi, sharding-jdbc are must be config with rule. If you needn't rule, you can try sharding-proxy.
i have same problem
the same version 5.0.0, I have config with rule, but still got No qualifying bean of type 'org.apache.shardingsphere.infra.config.mode.ModeConfiguration' available
the same version 5.0.0, I have config with rule, but still got
No qualifying bean of type 'org.apache.shardingsphere.infra.config.mode.ModeConfiguration' available
Can you provider your configuration?
i have same problem
Can you provider your configuration?
i have same problem
Can you provider your configuration?
spring: application: name: membership shardingsphere: datasource: names: master master: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/membership username: membership password: membership mode: type: Memory schema: name: master
i have same problem
Can you provider your configuration?
this is my issue:https://github.com/apache/shardingsphere/issues/13526
@SFlora Hi, sharding-jdbc are must be config with rule. If you needn't rule, you can try sharding-proxy.
But I can run successfully in version 5.0.0-beta without config "rules" Is "must be config with rule" a new requirement of the new version?
i have same problem
Can you provider your configuration?
I am using Spring Boot 2.1.1.RELEASE, pom.xml
:
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
<version>5.0.0</version>
</dependency>
application.properties
:
spring.shardingsphere.datasource.names = master1
spring.shardingsphere.datasource.master1.jdbc-url = jdbc:mysql://30.99.88.33:3306/xxx
spring.shardingsphere.datasource.master1.type = com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.master1.driver-class-name = com.mysql.jdbc.Driver
spring.shardingsphere.datasource.master1.username = asce
spring.shardingsphere.datasource.master1.password = xxx
spring.shardingsphere.datasource.master1.xxx = # 数据库连接池的其它属性
spring.shardingsphere.rules.encrypt.tables.t_user_a.columns.email.cipher-column=email
spring.shardingsphere.rules.encrypt.tables.t_user_a.columns.email.encryptor-name=encryptor_aes
spring.shardingsphere.rules.encrypt.encryptors.encryptor_aes.type = AES
spring.shardingsphere.rules.encrypt.encryptors.encryptor_aes.props.aes-key-value = xxxx
spring.shardingsphere.rules.encrypt.queryWithCipherColumn = true
spring.shardingsphere.props.sql.show = true
the same version 5.0.0, I have config with rule, but still got
No qualifying bean of type 'org.apache.shardingsphere.infra.config.mode.ModeConfiguration' available
you can add this configuration: spring.shardingshpere.mode.type=Memory
@ASCE1885 Hi bro, Can you change encryptor_aes to encryptor-aes. Then try it again.
@SFlora Hi, sharding-jdbc are must be config with rule. If you needn't rule, you can try sharding-proxy.
But I can run successfully in version 5.0.0-beta without config "rules" Is "must be config with rule" a new requirement of the new version?
yes, i think if you use sharding-jdbc, you hava sharding demand. Do you have other ideas?
spring.shardingshpere.mode.type=Memory
There are optional. So you can not set it
@ASCE1885 Hi bro, Can you change encryptor_aes to encryptor-aes. Then try it again.
after changing encryptor_aes to encryptor-aes the result is still the same. But I made some changes:
1) update spring boot to 2.3.4.RELEASE
2) add `spring.shardingshpere.mode.type=Memory` like @zjcnb say
now the project can launch successfully, but when I run a select SQL through MyBatis, there is a NoSuchElementException:null.
add
spring.shardingshpere.mode.type=Memory
like @zjcnb say
You needn't configuration mode Memory, And now the project can launch successfully, but when I run a select SQL through MyBatis, there is a NoSuchElementException:null.
it 's a new problem, Can you create new issue?
this is my configuration, in this configuration, i have excluded druid data source configuration in springboot runner class. the issue is : thank you
Which version of ShardingSphere did you use?
5.0.0
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected & Actual behavior
Reason analyze
I did not configure the properties of "spring.shardingsphere.rules" Because I only need to use the distributed transaction of ShardingSphere In version 5.0.0-beta, the above configuration can successfully start the application But in version 5.0.0, the return result of the method getMatchOutcome in the class LocalRulesCondition is noMatch An exception will be thrown during startup
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.shardingsphere.infra.config.mode.ModeConfiguration' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
If I configure the parameters spring.shardingsphere.mode.type= Memory The seata service will throw an exception againCaused by: java.lang.NullPointerException: Cannot invoke "org.apache.shardingsphere.infra.metadata.resource.CachedDatabaseMetaData.getUrl()" because "this.cachedDatabaseMetaData" is null
When I configure the "spring.shardingsphere.rules" parameters to successfully start the application