컴퓨터 관련/Java 정보
webflux R2DBC 빈 에러
보뇨
2021. 9. 14. 21:47
반응형
아직 Spring MVC 에 대해 완전 안다고는 말못하지만Reactive
가 재밌기때문에 WebFlux
공부할겸 이슈등록해두기로함
WebFlux
랑 R2DBC
가 찰떡이라고해서 등록했더니만 아래와 같은 에러를 뱉는다
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-09-14 21:41:42.141 ERROR 92257 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field schoolJpaRepository in com.joonseolee.webfluxboilerplate.service.SchoolService required a bean of type 'com.joonseolee.webfluxboilerplate.repository.SchoolJpaRepository' that could not be found.
Action:
Consider defining a bean of type 'com.joonseolee.webfluxboilerplate.repository.SchoolJpaRepository' in your configuration.
Disconnected from the target VM, address: '127.0.0.1:61078', transport: 'socket'
Process finished with exit code 1
왜 빈을 못찾을까 생각하다가 이전에는 이런적이 없었기때문에 당연히 R2DBC
문제인걸로 파악하고
로그를 더 확인하고있었는데 위로 올려보니 이런 글이 있었다.
2021-09-14 21:41:41.460 INFO 92257 --- [ main] .RepositoryConfigurationExtensionSupport : Spring Data R2DBC - Could not safely identify store assignment for repository candidate interface
com.joonseolee.webfluxboilerplate.repository.SchoolJpaRepository. If you want this repository to be a R2DBC repository, consider annotating your entities with one of these annotations:
org.springframework.data.relational.core.mapping.Table (preferred), or consider extending one of the following types with your repository: org.springframework.data.r2dbc.repository.R2dbcRepository.
엔티티에 Table
아노테이션을 넣어달라는 문구가 있어서 넣었더니 바로 작동되었다
이게...저 아노테이션을 넣어야지만 R2DBC
에 스캔?등을 찾는걸로 보인다
반응형