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
- PathVariable
- 배열
- MVC
- useContext
- springboot
- 부적합한열
- localStorage
- CRUD
- SQL
- Thymeleaf
- JDBC
- git amend
- git
- HTML
- Java
- ResultType
- oracle
- mybatis
- WHEREIN
- assertequals
- passwordencoder
- git revase
- git reset
- 이딴게개발자
- content-box
- Variabla
- Spring
- react
- JavaScript
- BCryptPasswordEncoder
Archives
- Today
- Total
개발새발
[Spring] parameter 1 of constructor in required a bean of type 'org.springframework.security.crypto.password.passwordencoder' that could not be found. 본문
오류잡기
[Spring] parameter 1 of constructor in required a bean of type 'org.springframework.security.crypto.password.passwordencoder' that could not be found.
칸쵸. 2024. 1. 25. 17:23728x90
회원가입 기능을 구현하려는 중...
보안을 위해 Spring security에서 제공하는 기능 주 중 하나인 PasswordEncoder를 사용하고자했다.
import org.springframework.security.crypto.password.PasswordEncoder;
분명 import까지 야무지게 해왔는데
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 1 of constructor in com.penpick.users.service.UserService required a bean of type 'org.springframework.security.crypto.password.PasswordEncoder' that could not be found.
음...
passwordEncoder가 bean으로 등록되지 않아서 생기는 문제같다.
고민 좀 하다가 SecurityConfig 파일에 들어가서 @Bean 설정한 메서드를 하나 추가해줌
@Bean
public PasswordEncoder passwordEncoder() {
PasswordEncoder encoder = new BCryptPasswordEncoder();
return encoder;
}
BCryptPasswordEncoder 를 Super Class로 하도록 설정
그리고 다시 실행
'오류잡기' 카테고리의 다른 글
[SpringBoot] org.springframework.web.bind.MissingPathVariableException (0) | 2023.11.28 |
---|---|
[SpringBoot] java.sql.SQLException: ORA-01017: 사용자명/비밀번호가 부적합, 로그온 할 수 없습니다. (0) | 2023.11.28 |
[SpringBoot] 부적합한 열 유형: 1111 (0) | 2023.11.27 |
[Java] NullPointException (0) | 2023.09.29 |
[Java] IndexOutOfBoundsException (0) | 2023.09.27 |