autowire异常主要由三个情况发生的

像上面的情况是BrandDao没有注入,


1。你的BrandServiceImpl必须以@Service或@Component注解才行。

 

2。自动写入的时候把接口写成实现类了
@Autowired
private BrandServiceImpl      brandServiceImpl;
应该是
@Autowired
private BrandService    brandService ;

 

3.在BrandDao 类上加上@Repository注解

相关文章:

  • 2021-09-12
  • 2021-09-20
  • 2021-09-26
  • 2022-01-05
  • 2021-07-16
  • 2022-12-23
  • 2021-08-30
猜你喜欢
  • 2022-12-23
  • 2021-12-09
  • 2021-11-26
  • 2021-09-20
相关资源
相似解决方案