spring-boot 启动时候 出现异常:The bean 'xxx' could not be injected as a 'xx.xxxx' because it is a JDK dynami

 

  1. @Resource
  2.  
    private UmsUserMapper userMapper;

如上代码会报错,这是因为程序中有一个UserMapper,所以当命名为userMapper会首先查找UserMapper这个类而不是UmsUserMapper这个类,改成umsUserMapper程序正常。注入时的变量命名很重要

posted @ 2020-10-22 14:12  疯子110  阅读(2342)  评论(0编辑  收藏  举报