Houssem
Houssem

Reputation: 69

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.

Upvotes: 2

Views: 11985

Answers (3)

Trojaner_
Trojaner_

Reputation: 71

For me, this issue occurred due to a dependency update of Spring Boot. I solved it by opening my application.properties and replacing every spring.redis with spring.data.redis.

Upvotes: 0

Mohammad Anas
Mohammad Anas

Reputation: 318

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.

Upvotes: 1

user1442999
user1442999

Reputation: 156

The error is misleading. You are missing some dependencies.

compile 'redis.clients:jedis'
compile 'org.apache.commons:commons-pool2'

Upvotes: 6

Related Questions