shardingsphere-jdbc-core-spring-boot-starter-5.0.0-alpha 启动报错,帮忙看看,谢谢各位大佬。

方便更快捷的说明问题,可以按需填写(可删除)

使用环境:

Java8 + SpringBoot 2.3.12 + shardingsphere-jdbc-core-spring-boot-starter-5.0.0-alpha

配置文件如下:point_down:

spring.shardingsphere.datasource.names=ds0
spring.shardingsphere.datasource.ds0.type=com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.ds0.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.ds0.jdbc.url=
spring.shardingsphere.datasource.ds0.username=
spring.shardingsphere.datasource.ds0.password=
spring.shardingsphere.rules.sharding.tables.t_order_wsy.actual-data-nodes=ds0.t_order_wsy_$->{201601…202512}
spring.shardingsphere.rules.sharding.tables.t_order_wsy.table-strategy.standard.sharding-algorithm-name=t-order-wsy-range
spring.shardingsphere.rules.sharding.tables.t_order_wsy.table-strategy.standard.sharding-column=created
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-wsy-range.type=INTERVAL
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-wsy-range.props.datetime-pattern=yyyy-MM-dd HH:mm:ss
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-wsy-range.props.datetime-lower=2016-01-01 00:00:00
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-wsy-range.props.datetime-upper=2025-12-01 00:00:00
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-wsy-range.props.sharding-suffix-pattern=yyyyMM
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-wsy-range.props.datetime-interval-amount=1
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-wsy-range.props.datetime-interval-unit=MONTHS

场景、问题:

代码启动报错:

Exception in thread “main” java.lang.reflect.UndeclaredThrowableException
at org.springframework.util.ReflectionUtils.rethrowRuntimeException(ReflectionUtils.java:147)
at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:818)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:322)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1247)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1236)
at com.nums.apifront.ApiFrontApplication.main(ApiFrontApplication.java:14)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.shardingsphere.spring.boot.util.PropertyUtil.v2(PropertyUtil.java:111)
at org.apache.shardingsphere.spring.boot.util.PropertyUtil.handle(PropertyUtil.java:75)
at org.apache.shardingsphere.spring.boot.registry.AbstractAlgorithmProvidedBeanRegistry.registerBean(AbstractAlgorithmProvidedBeanRegistry.java:50)
at org.apache.shardingsphere.sharding.spring.boot.algorithm.KeyGenerateAlgorithmProvidedBeanRegistry.postProcessBeanDefinitionRegistry(KeyGenerateAlgorithmProvidedBeanRegistry.java:38)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:280)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:126)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:707)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:533)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:755)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:402)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
… 3 more
Caused by: java.util.NoSuchElementException: No value bound
at org.springframework.boot.context.properties.bind.BindResult.get(BindResult.java:55)
… 20 more

已进行操作:

现状:

换用 5.1.2 版本试试看吧

京ICP备2021015875号