![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java杂类
猿小猴
越自律越自由
展开
-
Field XXX required a bean of type xxx SpringBoot启动报错
@ CartServiceImpl](这里写自定义目录标题)1 没有给dao层加@Mapper注解2 @Mapper注解包名引用错误3 主程序类没有加@MapperScan注解4 Bean所在的包名扫描不到,主程序类所在的包不包含该包。比如主程序类所在包为:com.atxiaohou.gmall.cart 但是所用到的bean在com.atxiaohou.gmall.util下,这两者是没有包含关系所以启动报错解决将主程序类移动到主包路径下,避免其他bean也出现同等错误...原创 2021-01-07 17:20:23 · 780 阅读 · 0 评论 -
Springboot整合Mybatis+Dubbo时服务方启动报错Field XXX required a bean of type XXX that could not be found
今天搭建Springboot项目一直报错Field XXX required a bean of type XXX that could not be foundspringboot的配置文件中如果有spring.dubbo.base-package就会报错,去掉就启动成功。配置文件如下:报错如下:因为在service层有用到mapper类,一直加载不到类,所以就报错了。解决方法:...原创 2019-10-29 22:14:25 · 1110 阅读 · 0 评论