分析解决The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true)问题
1.启动后报图错误
2.项目代码:
3.分析解决
1.可以将@Autowired注解改为@Resource,试一下。
2.我们在controller使用的service没有注入spring容器,那么我们可以在启动类上,加上包扫描注解,让这个bean所在的包能扫描到:
@ComponentScan(basePackages = {"com.aliqingge.service"})
注意:如果上述不能解决问题,那么可能你需要检查一下自己的实现类,是否是现实这个接口,由于本人是拆分公司的一个老项目,导致的这个service没有实现类实现所有导致,改造迁移多注意,慎重。