使用@Autowired注解时被标红线,找不到bean,could not autowire,no beans of "XX"

使用@Autowired注解时报错,could not autowire,no beans of "XX",是因为你没有写@Service和@Repository这些注解在相应的Java类中,其中注意@Service要注解在实现类中,而不是写在接口

posted @ 2021-03-17 14:58  张晨子  阅读(831)  评论(0编辑  收藏  举报