运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found

Posted 辉少呢

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found相关的知识,希望对你有一定的参考价值。

运行springboot项目报错:

***************************

APPLICATION FAILED TO START

***************************

Description:

Field userMapper in com.whohim.springboot.service.impl.UserServiceImpl required a bean of type \'com.whohim.springboot.dao.UserMapper\' that could not be found.

Action:

Consider defining a bean of type \'com.whohim.springboot.dao.UserMapper\' in your configuration.

Process finished with exit code 0

在项目启动类加上下面注解即可(扫描对应的mapper包)

 

以上是关于运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found的主要内容,如果未能解决你的问题,请参考以下文章

springboot创建项目后运行报错

SpringBoot项目启动没报错,直接停止运行

springboot 报错Field XXX required a bean of type XXX that could not be found.

创建springboot2.1项目运行报错

springboot项目有红叉,但是没有运行没有报错。

springboot maven项目运行常见报错 及ajax请求报错