小编Yas*_*h B的帖子

springboot从2.3.9升级到2.6.3后遇到错误

从 springboot 2.3.9 升级到 2.6.6 后,我的测试失败并出现以下错误,

java.lang.AssertionError: 
Expecting:
 <Unstarted application context org.springframework.boot.test.context.assertj.AssertableApplicationContext[startupFailure=org.springframework.beans.factory.UnsatisfiedDependencyException]>
to have a single bean of type:
 <com.air.dx.range.application.RangeApplicationService>:
but context failed to start:
 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'IRoRangeRepository': Unsatisfied dependency expressed through method 'setDialect' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.data.relational.core.dialect.Dialect' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
    
Run Code Online (Sandbox Code Playgroud)

升级后的一项观察,

spring-boot-test jar 中的ConfigFileApplicationContextInitializer类被修改为ConfigDataApplicationContextInitializer

java spring upgrade spring-boot

14
推荐指数
1
解决办法
3044
查看次数

标签 统计

java ×1

spring ×1

spring-boot ×1

upgrade ×1