공유메모장
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했는데, 앞으로는 세세하게 신경써야겠다...
'spring 공부 > spring' 카테고리의 다른 글
Spring Security 환경설정 하기 (0) | 2023.10.17 |
---|---|
[SpringMVC] 요청 파라미터가 객체로 전달된다고? (@ModelAttribute) (0) | 2023.09.05 |
스프링 컨테이너 적용 (0) | 2023.08.05 |
AppConfig과 IoC, DI (0) | 2023.08.03 |
Spring이 OCP와 DIP를 지키는 방식 (0) | 2023.08.03 |