Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Spring Data Jpa와 Spring Data Redis의 Repository 중복 scan 문제 #152

Open
kssumin opened this issue Aug 30, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@kssumin
Copy link
Contributor

kssumin commented Aug 30, 2024

버그 리포트 이슈 템플릿

어떤 이슈인가요?

스프링부트가 띄어질 때 다음과 같은 로그가 뜬다.
확인해보면 JpaRepository의 대상인 Entity들이 해당 로그의 원인인 것을 확인했다.

2024-08-29 18:03:06.969 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.auth.persistence.AccountRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository
2024-08-29 18:03:06.969 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.auth.persistence.OAuthMemberRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository
2024-08-29 18:03:06.969 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.comment.persistence.CommentRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository
2024-08-29 18:03:06.970 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.member.persistence.MemberRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository
2024-08-29 18:03:06.970 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.program.persistence.ProgramRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository
2024-08-29 18:03:06.970 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.target.persistence.AttendRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository
2024-08-29 18:03:06.970 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.target.persistence.PresentationRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository
2024-08-29 18:03:06.970 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.target.persistence.TeamBuildingTargetRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository
2024-08-29 18:03:06.971 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.team.persistence.TeamRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository
2024-08-29 18:03:06.971 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.teamBuilding.persistence.RestrictTeamBuildingRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository
2024-08-29 18:03:06.971 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.teamBuilding.persistence.TeamBuildingRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository
2024-08-29 18:03:06.971 [INFO] [main] [o.s.d.r.c.RepositoryConfigurationExtensionSupport] - Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.blackcompany.eeos.teamBuilding.persistence.TeamBuildingResultRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository

왜 발생했나요?

가능하면 given-when-then 형식으로 서술해주세요.

when

스프링부트를 실행할 때 다음과 같은 로그가 뜬다.

then

스프링부트를 실행할 때 더이상 다음과 같은 로그가 뜨지 않도록 한다.

어떤 해결방법들이 있나요? / 어떻게 해결했나요?

1. Spring Data Redis를 사용할 때 RedisTemplat통해 구현하였고 RedisRepository는 따로 사용하지 않는다.

spring:
	data:
    	redis:
			repositories:
			enabled: false

위 설정을 통해 Spring은 @repository 어노테이션이 붙은 인터페이스에 대해 자동으로 구현체를 생성하지 않는다.

@EnableJpaRepositories를 이용

  • @EnableJpaRepositories의 basePackages() 메소드를 이용하여 스캔할 패키지를 직접 지정

참고할만한 자료(선택)

Repository scan @EnableJpaRepositories 관련 자료

@kssumin kssumin added the bug Something isn't working label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant