Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Consider defining a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory' in your configuration

i try to use spring session and i dowload this project from git https://github.com/spring-guides/tut-spring-security-and-angular-js/tree/master/spring-session

and i get this error APPLICATION FAILED TO START


Description:

Parameter 0 of method sessionRedisTemplate in org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration required a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory' that could not be found.

Action:

Consider defining a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory' in your configuration.

like image 266
Houssem Avatar asked Jan 17 '26 22:01

Houssem


2 Answers

The error is misleading. You are missing some dependencies.

compile 'redis.clients:jedis'
compile 'org.apache.commons:commons-pool2'
like image 112
user1442999 Avatar answered Jan 19 '26 17:01

user1442999


In case somebody is facing an issue with springboot, might be following dependency in pom.xml is missing

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>

This missing dependency was misleading me to the error in the question.

like image 31
Mohammad Anas Avatar answered Jan 19 '26 18:01

Mohammad Anas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!