Notice
Recent Posts
Recent Comments
Link
«   2025/06   »
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
Tags
more
Archives
Today
Total
관리 메뉴

공유메모장

QuerydslRepositorySupport 를 상속하는 구현체를 만드는 중 required a bean of type 'java.lang.Class' that could not be found. 에러 해결법 본문

spring 공부/spring

QuerydslRepositorySupport 를 상속하는 구현체를 만드는 중 required a bean of type 'java.lang.Class' that could not be found. 에러 해결법

댕칠이 2023. 8. 25. 14:25

에러 상황

Querydsl 라이브러리를 이용해서 직접 구현할 때 구현체에 QuerydslRepositorySupport를 상속 한 후 프로젝트 또는 testcase를 실행했을 때 required a bean of type 'java.lang.Class' that could not be found. 발생

 

해결 방법

implements한 클래스에서 QuerydslRepositorySupport를 extends할 때 자동으로 생성된 코드를 보자. 

super(domainClass) <- domainClass에 내가 사용하고자 하는 Entity Class name을 명시해주어야 한다. 

(나의 경우 Entity Class 이름이 Board 였기 때문에 super(Board.class);로 코드를 변경했다. 

 

자동으로 오버라이딩 돼서 아무 생각없이 run했는데, 앞으로는 세세하게 신경써야겠다...