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