spring boot注入失敗的場景主要有java
該問題咱們在Controller層出現過, 具體代碼以下spring
@RestController @RequestMapping("/mis") public class XXXrMisController { @Autowired private MonitorMisService monitorMisService; @GetMapping("/Info") private CommonResponse<LiveUrlInfoRes> liveUrlInfo() { CommonResponse<LiveUrlInfoRes> commonResponse = CommonResponse.success(); return commonResponse.setResult(monitorMisService.Info(sn, channel)); } }
問題出如今liveURLInfo方法的做用域,使用private方法,相應的對MonitorMisService 的依賴就不能注入,改成public就能夠了。具體緣由待查app