问题描述:
springboot启动时报错
Description:
Field userService in com.demo.springboot.web.UserController required a bean of type 'com.demo.springboot.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 'com.demo.springboot.service.UserService' in your configuration.
- 初学springboot 在controller层 添加@AutoWired private UserService uservice 导致启动不了 参考网上的解决方法 为UserSevice添加@service 并没有生效,
- 由于自己的UserSevice 是个interface 猜测应该在实现层 UserServiceImpl 加上@service 重启后问题得到解决。