Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

springboot3.3.0,shardingsphere-jdbc-core-spring-boot-starter5.2.1进行单数据源分表程序启动异常 #34719

Open
liuwuchuhao opened this issue Feb 19, 2025 · 0 comments

Comments

@liuwuchuhao
Copy link

Question

For English only, other languages will not accept.

Before asking a question, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will close it.
一开始报错
org.yaml.snakeyaml.representer.Representer: method 'void ()' not found
引入

org.yaml
snakeyaml
1.33

报错
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.inspector.TagInspector
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[?:?]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[?:?]

配置如下
shardingsphere:
datasource:
names: base-log
base-log:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.103.220:3309/base_log?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: "XXXXXXX"
password: "XXXXXXXXXXX"
rules:
sharding:
tables:
login_log:
actual-data-nodes: base-log.login_log
table-strategy:
standard:
sharding-column: create_time
sharding-algorithm-name: table-year-month
sharding-algorithms:
table-year-month:
type: CLASS_BASED
props:
strategy: STANDARD
algorithmClassName: com.maxvision.base.log.config.TableShardingAlgorithm
props:
sql.show: true # Sharding-JDBC的属性配置,这项配置是将SQL打印输出到日志

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant