NoSuchMethodError when invoking RedisOperationsSessionRepository.delete
See original GitHub issueI’m using spring session and spring data redis for session management. I haven’t used Spring boot.
Used are as follows,
spring-session: 1.3.5.RELEASE
spring-data-redis: 2.1.4.RELEASE
spring-webmvc: 5.0.4.RELEASE
lettuce-core: 5.1.4.RELEASE
Included these beans for redis configuration: org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration, org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.
Included filter springSessionRepositoryFilter in web.xml.
But I got following error frequently.
ERROR org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task.
java.lang.NoSuchMethodError: org.springframework.data.redis.core.RedisOperations.delete(Ljava/lang/Object;)V
at org.springframework.session.data.redis.RedisSessionExpirationPolicy.cleanExpiredSessions(RedisSessionExpirationPolicy.java:132) ~[spring-session-1.3.5.RELEASE.jar:?]
at org.springframework.session.data.redis.RedisOperationsSessionRepository.cleanupExpiredSessions(RedisOperationsSessionRepository.java:398) ~[spring-session-1.3.5.RELEASE.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_201]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_201]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
java - NoSuchMethodError when invoking ... - Stack Overflow
NoSuchMethodError when invoking RedisOperationsSessionRepository.delete ... I'm using Spring Session and Spring Data Redis for session management.
Read more >[Solved]-NoSuchMethodError when invoking ...
Coding example for the question NoSuchMethodError when invoking RedisOperationsSessionRepository.delete-Java.
Read more >NoSuchMethodError: when invoking Redis opertaion Delete
Im using Spring session, Spring Data redis and redis clients for session management. Here im getting belw exception while deploy the ...
Read more >NoSuchMethodError (Java SE 18 & JDK 18)
Thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has...
Read more >org.springframework.data.redis.core.RedisOperations.delete ...
Best Java code snippets using org.springframework.data.redis.core.RedisOperations.delete (Showing top 20 results out of 315).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Okay. From where do I get spring session 2.x? Mine is Maven project and in maven repository(central) latest I could download is spring session 1.3.5.
I have upgraded the spring session version to spring-session-2.0.0.M2.jar , still, I am getting the same exception.
When I open the jar file I can see the delete method. So I created a package with the name org.springframework.session.data.redis and copied RedisSessionExpirationPolicy class from jar file. then the issue is resolved. I am not sure really its a dependency version issue