Spring Boot 报错:Consider defining a bean of type ‘com.UserService‘ in your configuration.

Posted 寂静花开

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Spring Boot 报错:Consider defining a bean of type ‘com.UserService‘ in your configuration.相关的知识,希望对你有一定的参考价值。

Consider defining a bean of type ‘com.moshang.msmall.service.UserService’ in your configuration.

其实是启动类没有扫描到报错这个文件

在启动类前加上注解

@MapperScan("com.moshang.msmall.dao")
@SpringBootApplication(scanBasePackages ="com.moshang")

以上是关于Spring Boot 报错:Consider defining a bean of type ‘com.UserService‘ in your configuration.的主要内容,如果未能解决你的问题,请参考以下文章

Spring Boot 报错:Consider defining a bean of type ‘com.UserService‘ in your configuration.

Consider defining a bean of type 'package' in your configuration [Spring-Boot]

Spring Boot @Autowired无法注入类 Consider defining a bean of type

Spring boot 启动错误处理:Action: Consider the following: If you want an embedded database (H2, HSQL or Der

Spring Boot:Action:Consider defining a bean of type '*.*.*' in your configuration解决方案

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