Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- Til
- 장고
- UOPEOPELE
- 암영
- 삽질일기
- 파이썬
- opencv
- 컴공과
- 가보자고
- 라즈베리파이
- 불공단스터디
- Python
- djangorestframework
- to all the errors i loved
- 해커스
- 매일매일쓰자허무하지않게
- 2024 1학기 기말 파이썬 프로젝트
- Flutter
- SUNLOG
- 불공단
- 공부기록
- 백엔드
- 기록
- DRF
- 1학기
- 다시도전
- 불공단_스터디
- 낭독
- django
- 대학생
Archives
- Today
- Total
기술해록본
java.lang.IllegalArgumentException: rawPassword cannot be null 본문
Develop/To All The Errors I've Loved Before
java.lang.IllegalArgumentException: rawPassword cannot be null
HaeYoung_12 2024. 10. 6. 15:00java.lang.IllegalArgumentException: rawPassword cannot be null
at org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder.encode
- 처음에는 BCryptPasswordEncoder 관련 @Autowired 문제라고 생각 했으나 블로그를 참고해보니
JSON BODY로 보내면 controller 에서 받을 때 인지를 할수 있게 @RequestBody 어노테이션을 작성했어야 하는데 붙이지 않아서 발생한 문제이다.
- 여기서
private static final Logger log = LoggerFactory.getLogger(userController.class);
@Autowired
private UserService service;
@PostMapping("/signup")
public ResponseEntity<?> SignUp(@Validated AddUserRequest addUserRequest, BindingResult result) {
if(result.hasErrors()) {
log.warn(result.toString());
return ResponseEntity.badRequest().body(result.getFieldError());
}
try {
Boolean flag=service.singUp(addUserRequest);
return ResponseEntity.ok().body(flag);
- 이렇게 수정했더니 해결
private static final Logger log = LoggerFactory.getLogger(userController.class);
@Autowired
private UserService service;
@PostMapping("/signup")
public ResponseEntity<?> SignUp(@RequestBody @Validated AddUserRequest addUserRequest, BindingResult result) {
if(result.hasErrors()) {
log.warn(result.toString());
return ResponseEntity.badRequest().body(result.getFieldError());
}
try {
Boolean flag=service.singUp(addUserRequest);
return ResponseEntity.ok().body(flag);
- 참고자료
https://grogrammer.tistory.com/42
[개발]🚨ERROR - java.lang.IllegalArgumentException: rawPassword cannot be null
🛤️상황 회원가입/로그인이 기존에 GET방식이었어서 POST 방식으로 바꾸려 하는데 이러한 오류가 발생하였다. 🌸과정 401 Unauthorized는 클라이언트 요청이 필요한 인증 자격증명을 제공하지 않았
grogrammer.tistory.com