-
[Error, Spring Boot + JPA] repository 위치 변경 시 에러개발기록 2022. 9. 22. 09:52반응형728x90
개요
JPA repository의 디렉토리를 변경하다 아래와 같은 에러를 마주쳤다.
JPA를 몇 번 안 써봐서 다음을 위해 해결방법을 기록해둔다.
에러내용
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of constructor in com.??.UserDetailsService required a bean of type 'com.??.UserRepository' that could not be found.
Action:
Consider defining a bean of type 'com.??.UserRepository' in your configuration.
Process finished with exit code 1해결방법
config 파일에 @EnableJpaRepositories("repository 경로")를 써준다.
package com.??.config; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Configuration; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.web.servlet.config.annotation.*; @Slf4j @Configuration @EnableWebMvc @EnableJpaRepositories("com.??") // 해당 부분을 추가한다. public class WebMvcConfig { }
728x90'개발기록' 카테고리의 다른 글
[메모장 hosts] hosts파일에서 ip와 도메인 주소 매핑하기 (0) 2022.09.27 [Spring Boot] Mybatis 설정(In application.properties) (0) 2022.09.27 [Spring Boot] Jasypt를 통한 암복호화 - application.properties에서 db 암호화 (0) 2022.09.21 [Spring Boot] Gradle 프로젝트에 외부 라이브러리(*.jar) 추가하는 방법 (0) 2022.09.21 [Spring Boot] 스케쥴러를 이용한 스케쥴링(Scheduler) (0) 2022.09.19