springboot项目启动时报错Service找不到
Field userService in cn.xaut.controller.UserController required a bean of type ‘cn.xaut.service.UserService’ 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 ‘cn.xaut.service.UserService’ in your configuration.
解决方案
1.包结构的问题
启动类Application应该放在外面
2.忘记写注解
@service
@Autowired