Skip to content
Advertisement

Dependency error in Spring boot for Spring session and Redis. What is the correct dependency i have to use?

I have angular 2 front-end and spring boot back-end.I want to use username and password for login and then use x-auth-token to check session for each request sent from angular.I want to use Redis to store session.But i keep getting the below error when connecting to Redis.My assumption is my dependency version of spring session is causing the issue but i am not able to understand why that is? –

An attempt was made to call a method that does not exist. The attempt was made from the following location: org.springframework.session.data.redis.config.ConfigureNotifyKeyspaceEventsAction.getNotifyOptions(ConfigureNotifyKeyspaceEventsAction.java:74) The following method did not exist: org.springframework.data.redis.connection.RedisConnection.getConfig(Ljava/lang/String;)Ljava/util/List; The method's class, org.springframework.data.redis.connection.RedisConnection, is available from the following locations: jar:file:/C:/Users/Ajay/.m2/repository/org/springframework/data/spring-data-redis/2.3.3.RELEASE/spring-data-redis-2.3.3.RELEASE.jar!/org/springframework/data/redis/connection/RedisConnection.class The class hierarchy was loaded from the following locations: org.springframework.data.redis.connection.RedisConnection: file:/C:/Users/Ajay/.m2/repository/org/springframework/data/spring-data-redis/2.3.3.RELEASE/spring-data-redis-2.3.3.RELEASE.jar Action: Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.redis.connection.RedisConnection

Spring –

JavaScript

pom.xml-

JavaScript

Advertisement

Answer

I think pom.xml is bit messed up. You have conflicting dependencies.

Use below command to see details of which dependencies are loaded n which are omitted.

mvn dependency:tree -Dverbose -Dincludes=commons-collections

That will give you some insights.

https://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html

Also in my opinion can you try removing below dependency and run the application.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement