Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

导入包后运行登录报错 #9

Open
LoveyanMax opened this issue Nov 11, 2020 · 2 comments
Open

导入包后运行登录报错 #9

LoveyanMax opened this issue Nov 11, 2020 · 2 comments

Comments

@LoveyanMax
Copy link

LoveyanMax commented Nov 11, 2020

导入包后运行登录报错:
org.springframework.security.authentication.InternalAuthenticationServiceException: Cannot find cache named 'user' for Builder
请问是前端要加统一拦截么

@OverRide
@Cacheable(key = "'username:' + #p0")
public UserDto findByName(String userName) {
User user = userRepository.findByUsername(userName);
if (user == null) {
throw new EntityNotFoundException(User.class, "name", userName);
} else {
return userMapper.toDto(user);
}
}

@LoveyanMax
Copy link
Author

找到问题了,是@Cacheable与redisson同用时报错 在配置文件中指定缓存类型:
spring:
cache:
type: redis解决问题

@hl128k
Copy link

hl128k commented Jan 27, 2022

确实有用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants