Field userService in com.wuji.controller.UserController required a bean of type 'com.wuji.service.UserService' that could not be found

Field userService in com.wuji.controller.UserController required a bean of type 'com.wuji.service.UserService' that could not be found.

原因:说明IOC里没有创建Bean,在启动文件上手动添加:@ComponentScan(basePackages = {"com.wuji"})注解开启Spring组件扫描

上一篇:解决:Field xxMapper in xx.service.impl.xxServiceImpl required a bean of type 'xx.mapper.xxMapper'


下一篇:maven多模块启动required a bean of type com.xxx.xxx.service that could not be found.