小编Rav*_*dje的帖子

spring注释@ConditionalOnMissingBean有什么作用?

我正在尝试启动已使用此批注的springboot应用程序。当我尝试启动应用程序时,出现以下错误:

org.springframework.boot.autoconfigure.condition.OnBeanCondition $ BeanTypeDeductionException无法推断com.shutterfly.sbs.platform.SbsPlatformConfigurationClientConfig.getRestTemplate的bean类型

码:

@ConditionalOnMissingBean
@Bean
public RestTemplate getRestTemplate() {
    return new RestTemplate();
}
Run Code Online (Sandbox Code Playgroud)

java spring spring-boot

8
推荐指数
4
解决办法
7850
查看次数

标签 统计

java ×1

spring ×1

spring-boot ×1