Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commentQueryRepositoryImpl' defined in com.example.query.infra.jpa.CommentQueryRepositoryImpl defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Not a managed type: class com.example.core.domain.comment.entity.Comment
좀더 확인해보니
Caused by: java.lang.IllegalArgumentException: Not a managed type: class com.example.core.domain.comment.entity.Comment
Comment를 찾을 수 없다고 합니다...
그래서 @EntityScan을 추가해보았지만 여전히 에러가 발생했습니다.
@Getter
@Entity
@EntityScan
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Comment {
...
}
알고보니 멀티모듈을 적용하고 @ComponentScan(basePackages)를 통해
ComponentScan을 Commend(sns)모듈에서만 하고있었습니다.
query모듈에도 적용해 주니 해결되었습니다.
@SpringBootApplication
@ComponentScan(basePackages = {"com.example.core","com.example.query"})
public class QueryApplication {
public static void main(String[] args) {
SpringApplication.run(QueryApplication.class, args);
}
}
'Project > 개인프로젝트' 카테고리의 다른 글
MongoDB Capped collection 버퍼 크기 에러 (0) | 2023.11.21 |
---|---|
[Error] Kafka Consumer UnrecognizedPropertyException (0) | 2023.10.21 |
[Error] Multi Module 적용 에러 (0) | 2023.10.19 |
Spring Integration 적용하기 (0) | 2023.10.07 |
ThreadLocal적용하여 Thread 안에서의 값을 공유하기 (0) | 2023.10.07 |