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程序正常。注入时的变量命名很重要


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM