autowire異常主要由三個情況發生的
像上面的情況是BrandDao沒有注入,
1。你的BrandServiceImpl必須以@Service或@Component注解才行。
2。自動寫入的時候把接口寫成實現類了
@Autowired
private BrandServiceImpl brandServiceImpl;
應該是
@Autowired
private BrandService brandService ;
3.在BrandDao 類上加上@Repository注解