Spring RedisTemplate 执行lua脚本时报错, 如下异常信息栈, 主要原因是没有设置对应的lua执行结果类型导致的_一个有梦想的男人的博客-程序员宅基地

技术标签: spring  redisTemplate  RedisSystemException  Redis  lua  redis  

 Spring RedisTemplate 执行lua脚本时报错, 如下异常信息栈, 主要原因是没有设置对应的lua执行结果类型导致的,做个笔记吧

 script = new DefaultRedisScript<>();
        //        script.setResultType(Boolean.class);  这个设置很重要的哦
        script.setScriptSource(new ResourceScriptSource(new ClassPathResource(LUA_SCRIPT_FILE_CLASSPATH)));

 

org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is io.lettuce.core.RedisException: java.lang.IllegalStateException
	at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:74)
	at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41)
	at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44)
	at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42)
	at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:268)
	at org.springframework.data.redis.connection.lettuce.LettuceScriptingCommands.convertLettuceAccessException(LettuceScriptingCommands.java:236)
	at org.springframework.data.redis.connection.lettuce.LettuceScriptingCommands.evalSha(LettuceScriptingCommands.java:195)
	at org.springframework.data.redis.connection.DefaultedRedisConnection.evalSha(DefaultedRedisConnection.java:1318)
	at org.springframework.data.redis.connection.DefaultStringRedisConnection.evalSha(DefaultStringRedisConnection.java:1729)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.data.redis.core.CloseSuppressingInvocationHandler.invoke(CloseSuppressingInvocationHandler.java:61)
	at com.sun.proxy.$Proxy146.evalSha(Unknown Source)
	at org.springframework.data.redis.core.script.DefaultScriptExecutor.eval(DefaultScriptExecutor.java:77)
	at org.springframework.data.redis.core.script.DefaultScriptExecutor.lambda$execute$0(DefaultScriptExecutor.java:68)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:171)
	at org.springframework.data.redis.core.script.DefaultScriptExecutor.execute(DefaultScriptExecutor.java:58)
	at org.springframework.data.redis.core.script.DefaultScriptExecutor.execute(DefaultScriptExecutor.java:52)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:346)
	at com.zhongan.core.dsp.service.impl.FlowControlServiceImpl.check(FlowControlServiceImpl.java:60)
	at com.zhongan.core.dsp.service.strategies.AbstractApiProcessStrategy.currentLimitChecking(AbstractApiProcessStrategy.java:122)
	at com.zhongan.core.dsp.service.strategies.AbstractApiProcessStrategy.doProcess(AbstractApiProcessStrategy.java:69)
	at com.zhongan.core.dsp.service.impl.ApiServiceImpl.apiQuery(ApiServiceImpl.java:90)
	at com.zhongan.core.dsp.web.controller.ApiController.process(ApiController.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:867)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:214)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at app.myoss.cloud.web.spring.web.servlet.filter.ReaderBodyHttpServletRequestFilter.doFilterInternal(ReaderBodyHttpServletRequestFilter.java:49)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at app.myoss.cloud.web.spring.web.servlet.filter.LogWebRequestFilter.doFilterInternal(LogWebRequestFilter.java:241)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.cloud.sleuth.instrument.web.ExceptionLoggingFilter.doFilter(ExceptionLoggingFilter.java:50)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at brave.servlet.TracingFilter.doFilter(TracingFilter.java:86)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1588)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1557)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:502)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
	at java.lang.Thread.run(Thread.java:745)
Caused by: io.lettuce.core.RedisException: java.lang.IllegalStateException
	at io.lettuce.core.LettuceFutures.awaitOrCancel(LettuceFutures.java:129)
	at io.lettuce.core.FutureSyncInvocationHandler.handleInvocation(FutureSyncInvocationHandler.java:69)
	at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80)
	at com.sun.proxy.$Proxy124.evalsha(Unknown Source)
	at org.springframework.data.redis.connection.lettuce.LettuceScriptingCommands.evalSha(LettuceScriptingCommands.java:193)
	... 88 common frames omitted
Caused by: java.lang.IllegalStateException: null
	at io.lettuce.core.output.CommandOutput.set(CommandOutput.java:85)
	at io.lettuce.core.protocol.RedisStateMachine.safeSet(RedisStateMachine.java:357)
	at io.lettuce.core.protocol.RedisStateMachine.decode(RedisStateMachine.java:138)
	at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:708)
	at io.lettuce.core.protocol.CommandHandler.decode0(CommandHandler.java:672)
	at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:667)
	at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:587)
	at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:556)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:648)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:583)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:500)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	... 1 common frames omitted

 

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_37657245/article/details/90474675

智能推荐

[易飞]三、邮件预警-厂内超期(14天)未完工工单_厦门德仔的博客-程序员宅基地

SQL: SELECT MOCTA.TA001+'-'+MOCTA.TA002 单据号, ZE.dbo.Date10(MOCTA.TA040) 单据日期, MOCTA.TA006 品号, MOCTA.TA034 品名, MOCTA.TA035 规格, ZE.dbo.Date10(MOCTA.TA010) 预计完工日, convert(decimal(15,2),MOCTA.TA015) 预计产量

音乐API_白玉梁的博客-程序员宅基地_音乐api

博主在前几篇博客中介绍了小Q聊天机器人的源码及其包含的一些功能,并在应用市场上上线了一个版本,其中有一个功能是歌曲搜索,即输入格式为“歌曲#歌曲名#歌手”即可搜索出相应的歌曲并进行播放,不过最近两天在使用时发现一只提示“歌曲获取失败”,于是在代码中打印了一些log,发现该音乐搜索api(抓自百度音乐盒)失效,其实也不算失效,只是返回的数据为空了!不知道是间歇性的,还是百度发现后封了,或者更换了链接?

Android Dialog 简单封装_正怒月神的博客-程序员宅基地

转载:https://www.cnblogs.com/zjjne/archive/2013/10/03/3350382.htmlpublic class MyAlertDialog { //region 确认/取消 弹出框 //取消按钮,默认canel public static Dialog createConfirmDialog(Context context, S...

Android 消息机制原理分析-Handler Message MessageQueue Looper_小沙弥爱吃肉的博客-程序员宅基地

安卓消息机制以下源码皆基于安卓SDK版本:android-28本文纯属本人基于安卓源码对安卓消息机制的总结。Message篇对于Message类,我们只需要关注以下部分即可:public final class Message implements Parcelable{ long when; Message next; // 以下省略其他的成员变量和方法}Handler篇对于Handler,我们主要讲解两个方面:Handler是如何处理消息的Handler发送消息

Django+uWSGI+nginx+CentOS服务器部署_haeasringnar的博客-程序员宅基地

亲测,一文带你部署django/flask到你的linux服务器(这里是阿里云其他服务器类似),注意:这里使用的是 阿里云服务器centos6.8 Python3.x Django1.11.x/Flask 0.12.2前提条件:1、一定的linux基础2、一个可正常运行的Django项目/Flask项目3、如果有数据库,需要自行先安装好(注意数据库一定要在安装/升级Python...

Android Studio与SonarQube关联完成代码扫描_007号搬运工的博客-程序员宅基地

下载地址:https://www.sonarqube.org/downloads/建议下载7.0版本,这个版本支持Java JDK 1.8,最新的SonarQube需要JDK11以上

随便推点

linux-C管道_deepfuture的博客-程序员宅基地

#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;sys/types.h&amp;gt;#include &amp;lt;unistd.h&amp;gt;void read_data(int pipes[]){//从管道读数据 char c; int rc; close(pipes[1]);//读进程不用写管道pipes[1]为写管道 while ((rc=...

高收入的背后,码农的亚健康问题也不容忽视_halley_wang的博客-程序员宅基地

最近,极光大数据发布了一份关于程序员的调研报告,触及了这个群体的诸多方面。调研结果显示,大部分程序员确实有着相对较高的薪资水平,但加班也成为了他们难逃的宿命。更值得关注的是,亚健康已经成为了这个群体不容忽视的一个问题。调研结果显示,程序员中存在亚健康症状的比例要明显高于其它职业,有63.3%的受访程序员目前正处于亚健康状态。在这个群体中,占比最高的健康问题依次为经常性疲倦、颈椎病和体重超标。与此同...

AI经典书单 | 入门人工智能该读哪些书?_软件供应链的博客-程序员宅基地

目送“我慢慢地、慢慢地了解到,所谓父子母女一场,只不过意味着,你和他的缘分就是今生今世,不断地在目送他的背影渐行渐远。你战力在小路的这一端,看着他逐渐消失在小路转弯的地方,而且,他用背影默默告诉你:不必追”——龙应台快问快答:学习人工智能该读哪些书可以快速入门呢?我的答案是多读经典书。方向对了即使慢点,总会走向成功的终点。而该读哪些书,我带来了五份经典书单。

.htaccess实现301重定向的实例方法_haocaicai的博客-程序员宅基地_.htaccess 重定向

一:通过.htaccess做重定向重定向www.lituanmin.com到 lituanmin.com也是出于同样的原因,只是形式不同。打开.htaccess文件,加入以下规则。1.重定向lituanmin.com到 www.lituanmin.com RewriteEngine On RewriteCond %{HTTP_HOST} ^lituanmin.com...

使用wx-open-launch-weapp完成在微信浏览器vue 页面跳转微信小程序(uni-app)_假装小清新的博客-程序员宅基地

需求:在监测到用户使用微信浏览器访问网站的时候,给他跳转到微信小程序使用的iview-admin跳转的小程序是uni-app写的官网地址:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html#21注意事项微信开放标签有最低的微信版本要求,以及最低的系统版本要求。 微信版本要求为:7.0.12及以上。 系统版本要求为:iOS 10.3及以上、Android 5.0及以上。在使用之前要注意

python3 java调用python出现中文乱码解决方案_程序白阿渣的博客-程序员宅基地

可能以下有些自己的吐槽话,如果不想看直接跳到最下面即可查看方法。搜罗网上一大堆垃圾信息,在这里给大家提个醒,接下来说的方法,都是本人亲测,不能解决乱码问题的。网上真的一大堆复制粘贴的东西,都不知道那些人有没测试过的。1.在头部加上# encoding:utf-8等方式(因为还有很多写法就不列出来)2.data.encode(‘utf-8’, errors=‘ignore’).decode(...

推荐文章

热门文章

相关标签