码迷,mamicode.com
首页 > 编程语言 > 详细

spring boot注入error,Consider defining a bean of type 'xxx' in your configuration问题解决方案

时间:2018-09-10 11:58:46      阅读:2914      评论:0      收藏:0      [点我收藏+]

标签:repos   ring   conf   解决   文件   you   XML   config   问题   

经常出现这问题一定是非spring生态圈的@标签 没被spring引入,如mybatis等

因为在默认情况下只能扫描与控制器在同一个包下以及其子包下的@Component注解,以及能将指定注解的类自动注册为Bean的@Service@Controller和@ Repository

那个这个时候就需要@ComponentScan或者@MapperScan了

 

要是xml配置注入有这问题,麻烦一遍一遍看xml文件的配置,绝对是哪里没写匹配。

spring boot注入error,Consider defining a bean of type 'xxx' in your configuration问题解决方案

标签:repos   ring   conf   解决   文件   you   XML   config   问题   

原文地址:https://www.cnblogs.com/ydymz/p/9618143.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!