为了账号安全,请及时绑定邮箱和手机立即绑定

springboot session redis 共享缓存 报 java.lang.NoSuchMethodError错

springboot session redis 共享缓存 报 java.lang.NoSuchMethodError错

MM们 2019-01-17 05:19:46
我用spring-session 和 redis 做session共享 ,然后报以下错误,看着好像是 spring-context-5.0.7.RELEASE 和 spring-session-1.3.3.RELEASE 冲突了, 可是我没有直接引用 spring-context,是在某个stater包里吗,求大神指导 2018-07-31 08:24:00.002 ERROR 18436 --- [pool-2-thread-1] o.s.s.s.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.3.RELEASE.jar:na] at org.springframework.session.data.redis.RedisOperationsSessionRepository.cleanupExpiredSessions(RedisOperationsSessionRepository.java:398) ~[spring-session-1.3.3.RELEASE.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_101] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_101] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_101] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_101] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_101] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_101] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_101] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_101] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_101] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
查看完整描述

2 回答

?
鸿蒙传说

TA贡献1865条经验 获得超7个赞

我找到问题了,原因是 我使用springboot的版本是 2.0.3,改回1.5.9就好了
用springboot 2 集成 redis + jedis + spring-session + security 做登录和session共享 还需要在研究下

查看完整回答
反对 回复 2019-02-12
?
ibeautiful

TA贡献1993条经验 获得超5个赞

除了降级,应该还有其他的解决方法吧?

查看完整回答
反对 回复 2019-02-12
  • 2 回答
  • 0 关注
  • 1060 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信