Spring boot 중복된 Bean 에러
2023. 11. 30. 20:16ㆍSpringboot
Spring boot에 빈으로 등록된 class는 한 개인데, 에러가 발생하는 경우
1. 에러 상황
nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'memberRepository' for bean class [클래스 경로] conflicts with existing, non-compatible bean definition of same name and class SecurityConfig
해당 에러는 파일의 이동 또는 삭제를 하면서 빈에 대한 기록이 아직 남아 있을 때, 생기는 오류입니다.
2. 에러 해결 방법
이전에 빌드된 클래스 파일을 없애줌으로써 오류를 해결이 가능합니다.
Intellij IDE사용을 안 하신다면 내부 terminal을 통해서./gradlew clean을 통해 해결할 수 있습니다.
'Springboot' 카테고리의 다른 글
Spring boot 환경 변수 설정 (1) | 2023.12.05 |
---|---|
Spring boot Test code(1) (0) | 2023.12.04 |
Spring HTTP 요청과 응답 (0) | 2023.11.13 |
Spring boot의 인증 방식 (0) | 2023.11.10 |
스프링 유저 프로필 사진 (5) | 2023.11.09 |