xxx required a bean of type 'com.xxx.utils.http.sss' that could not be found.
Consider defining a bean of type 'com.xxx.utils.http.sss' in your configuration.
原因 :
sss 这个类上面加了 @ConditionalOnBean(name = {"xxxTemplate"})
解决办法:
去掉 @ConditionalOnBean(name = {"xxxTemplate"}) 注解
写个配置类,类上面加上@Configuration,然后在这个类里面写个方法加上@Bean
方法里面new 一个 xxxTemplate对象,通过这种方式把Bean注入进去
在Spring Boot应用中遇到一个bean定义错误,具体是找不到类型为'com.xxx.utils.http.sss'的bean。该问题源于@ConditionalOnBean(name={xxxTemplate}

被折叠的 条评论
为什么被折叠?



