Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

Spring dependency injection not finding repository bean after adding spring-boot-starter-data-redis dependency

$
0
0

I have this spring boot project (version 2.3.3.RELEASE) that uses Spring Webflux and Spring Data and R2DBC. It was working fine until I added the following dependency:

implementation 'org.springframework.boot:spring-boot-starter-data-redis'

After this, Spring can't start because it can't resolve the dependency for this object:

interface BookingCountRepository : ReactiveCrudRepository<BookingCount, String> {...}

The error message is the following:

2021-12-22 10:20:59,916 [main]    ERROR [] o.s.b.d.LoggingFailureAnalysisReporter - __***************************_APPLICATION FAILED TO START_***************************__Description:__Parameter 1 of constructor in xx.xx.xx.xx.BookingService required a bean of type 'xx.xx.xx.xx.BookingCountRepository' that could not be found.___Action:__Consider defining a bean of type 'xx.xx.xx.xx.BookingCountRepository' in your configuration._

If I remove the spring-boot-starter-data-redis dependency, the problem stops happening.

My hunch is that it's probably a dependency hell issue, with a conflict between org.springframework.boot:spring-boot-starter-data-r2dbc and org.springframework.boot:spring-boot-starter-data-redis. But I don't know for sure.

Did anyone have trouble with this? If you did, how did you solve this problem?

FYI: JVM Runtime is OpenJDK 11, language is Kotlin, and spring boot version is 2.3.3.RELEASE


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>