Field xxService in xx.xx.controller required a bean of type ‘xx.xxService‘ that could not be found.

错误

启动Spring boot项目时,找不到controller,或者service文件
在这里插入图片描述

***************************
APPLICATION FAILED TO START
***************************

Description:

Field jobService in com.qike.quartz.controller.SysJobController required a bean of type 'com.ruoyi.quartz.service.ISysJobService' that could not be found.

The injection point has the following annotations:
	- @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.ruoyi.quartz.service.ISysJobService' in your configuration.

处理方法

1、Application启动类中有没有添加包扫描注解@ComponentScan(basePackages=“com.ruoyi”)
在这里插入图片描述
2、Controller层和service层有没有添加@Controller和@Service注解

猜你喜欢

转载自blog.csdn.net/Ls66666Ls/article/details/131455999