The bean ‘xxx‘ could not be injected as a ‘xxx‘ because it is a JDK dynamic proxy that implements:
问题: The bean ‘xxx‘ could not be injected as a ‘xxx‘ because it is a JDK dynamic proxy that implements:
这里说一种比较特殊的情况
很多网友在加了proxy-target-class = true 后依然报错,
这里需要排查是否有相同的变量类名,因为这里报的是注入错误
比如两个servie接口
A 类 {
private XXServiceImpl xxServiceImpl ;
@Autowired
private SystemUserMapper userMapper;
}
B 类 {
private XXServiceImpl xxServiceImpl ;
@Autowired
private WebUserMapper userMapper;
}
如果这两个SystemUserMapper ,WebUserMapper 恰好使用了mybaits-plus代理,那就或出现上述问题,只需要将名字改成不同的就可以了