首页

解决io.lettuce.core.RedisCommandExecutionException: ERR wrong number of arguments for set command异常

标签:RedisCommandExecutionException,RedisSystemException     发布时间:2022-09-20   

一、错误异常

使用springboot项目代码使用redis-2.4.2-win32-win64-fix版本报错“org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR wrong number of arguments for 'set' command...Caused by: io.lettuce.core.RedisCommandExecutionException: ERR wrong number of arguments for 'set' command”错误异常,日志详情>>

org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR wrong number of arguments for 'set' command@b@	at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:54)@b@	at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:52)@b@	at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41)@b@	at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44)@b@	at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42)@b@	at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:268)@b@	at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.convertLettuceAccessException(LettuceStringCommands.java:799)@b@	at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.set(LettuceStringCommands.java:180)@b@	at org.springframework.data.redis.connection.DefaultedRedisConnection.set(DefaultedRedisConnection.java:281)@b@	at org.springframework.data.redis.cache.DefaultRedisCacheWriter.lambda$put$0(DefaultRedisCacheWriter.java:90)@b@	at org.springframework.data.redis.cache.DefaultRedisCacheWriter.execute(DefaultRedisCacheWriter.java:242)@b@	at org.springframework.data.redis.cache.DefaultRedisCacheWriter.put(DefaultRedisCacheWriter.java:87)@b@	at org.springframework.data.redis.cache.RedisCache.put(RedisCache.java:144)@b@	at com.meizhi.service.UserService.getUserById(UserService.java:99)@b@	at com.meizhi.service.UserService$$FastClassBySpringCGLIB$$68076eba.invoke(<generated>)@b@	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)@b@	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684)@b@	at com.meizhi.service.UserService$$EnhancerBySpringCGLIB$$49acc48e.getUserById(<generated>)@b@	at com.meizhi.controller.UserController.userDetail(UserController.java:25)@b@	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)@b@	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)@b@	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)@b@	at java.lang.reflect.Method.invoke(Method.java:498)@b@	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)@b@	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)@b@	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)@b@	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)@b@	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)@b@	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)@b@	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)@b@	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)@b@	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)@b@	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)@b@	at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)@b@	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)@b@	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)@b@	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)@b@	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)@b@	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)@b@	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)@b@	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)@b@	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)@b@	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)@b@	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)@b@	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)@b@	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)@b@	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)@b@	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)@b@	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)@b@	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)@b@	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)@b@	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)@b@	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)@b@	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)@b@	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)@b@	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)@b@	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)@b@	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)@b@	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)@b@	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)@b@	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)@b@	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)@b@	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)@b@	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)@b@	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)@b@	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)@b@	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853)@b@	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587)@b@	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)@b@	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)@b@	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)@b@	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)@b@	at java.lang.Thread.run(Thread.java:748)@b@Caused by: io.lettuce.core.RedisCommandExecutionException: ERR wrong number of arguments for 'set' command@b@	at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:135)@b@	at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:108)@b@	at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:120)@b@	at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:111)@b@	at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:646)@b@	at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:604)@b@	at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:556)@b@	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)@b@	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)@b@	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)@b@	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1421)@b@	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)@b@	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)@b@	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)@b@	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)@b@	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:697)@b@	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632)@b@	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549)@b@	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511)@b@	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)@b@	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)@b@	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)@b@	... 1 more

二、解决方法

升级redis版本,如换为Redis-x64-5.0.14版本即可解决问题

  • ◆ 相关内容
<<推荐下载>>
  • (1) 阿里巴巴Java开发手册8种不同版本
  • (2) Web前端开发视频教程
  • (3) 30+明星讲师PPT课件分享一线大厂架构实战经验
  • (4) java开发_架构篇_视频资源分享_v2208
  • (5) java开发_高级篇_视频资源分享_v2208
  • (6) java开发_进阶篇(中级)_视频资源分享_v2208
  • (7) java开发_入门篇_视频资源分享_v2208
  • (8) 微信小程序开发视频1+167源码+实战demo等下载
  • (9) easy-shopping电子商务java源码(附脚本和安装文档说明)下载
  • (10) java常用的72份知名实用的电子书下载
  • (11) java开发性能优化资料整理大全(8份电子文档+3份实战优化)下载
  • (12) 9个常用的算法设计资料和100以上视频课件内容下载
  • (13) vue开发必备常用手册16件下载
  • (14) 21种不同技术集群方案(es、flink、redis、nginx、zk、lvs、kafka、mysql、k8s等)参考资料下载
  • (15) 20种技术代码规范(js/java/dba/阿里/华为/oracle/mysql等)参考资料下载
  • (16) 微服务五套资料(0-1,架构设计,springcloud,nacos等)下载
  • (17) 架构师(28知识图谱+3套简历模板+6套架构实战文档等)完整资料整理下载
  • (18) 大数据18套实战基础知识+8套简历模板下载
  • (19) 并发编程全套(7套+阿里巴巴+亿级实战等)实战资料下载
  • (20) Kafka九套学习整理知识点全套(面试+笔记+代码api+命令+容备等)资料下载
  • (21) java全套9个不同方向类型的面试题(基础+核心+大厂+架构师+近万套题库等)下载
  • (22) JAVA开发常用API帮助文档大全(超52种以上技术资料,高手必备)下载
  • (23) springcloud超详细139件全套学习实战资料( 视频课件+源码demo+文档资料等)下载
  • 更多推荐>>
  • <<热门文章>>