java.lang.StackOverflowError: null(栈溢出异常)
@Service public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService { @Autowired private AuthenticationManager authenticationManager; @Override public SysUser saveSysUser(SysUser sysUser) { BCryptPasswordEncoder bcPassWord = new BCryptPasswordEncoder(); sysUser.setPassword(bcPassWord.encode(sysUser.getPassword())); save(sysUser); return sysUser; } @Override public ResponseResult<SysUser> login(SysUser sysUser) { UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(sysUser.getUserName(),sysUser.getPassword()); Authentication authentication = authenticationManager.authenticate(authenticationToken); if(Objects.isNull(authentication)){ throw new RuntimeException("认证未通过"); } return null; }
这里使用了@Resource就爆了这个异常,使用@Autowired就不报这个异常。原因尚未明确,等我以后来填坑
标签:Resource,Autowired,sysUser,SysUser,new,public,内存 From: https://www.cnblogs.com/shishenapr/p/17306291.html