redis报错:jedis connection exception unexpected end of stream
一般的话,原因是你在spring中把jedis客户端配置成了单例模式(singleton),所以当在极短时间内,有多个请求连续发送过来时,jedis就会报错,说一个连接还没结束。
所以正确的配置是,将jedis配置成原型模式,每一次注入都产生一个新对象。
<!-- redis客户端 --><bean name="redis" class="redis.clients.jedis.Jedis" scope="prototype" ><constructor-arg name="host"><value>127.0.0.1</value></constructor-arg><constructor-arg name="port"><value type="int">6379</value></constructor-arg></bean>
上面的代码中,增加了scope="prototype"
参考:
Unexpected end of stream
看 “dbubenheim ”回到部分
redis报错:jedis connection exception unexpected end of stream相关推荐
- 使用客户端jedis时报错Could not get a resource from the pool 以及使用Spring Data Redis报错解决方法
一.Jedis 报错 今天在使用jedis时,一直报错 Could not get a resource from the pool 在网上找了好多解决的方法,并且找了半天错误,才发现是我的启动方式有 ...
- 【Exception】Navicat连接Oracle闪退 Navicat连接Oracle 报错:connection to server failed,probable Oracle Net admi
[Exception]Navicat连接Oracle闪退 Navicat连接Oracle 报错:connection to server failed,probable Oracle Net admi ...
- 阿里云 java程序 链接redis 报错 : IO Error: Connection reset
阿里云 java程序 链接redis 报错 : IO Error: Connection reset 报错内容 2018-03-07 17:33:41.224 ERROR [main][Worker. ...
- 03-Redis客户端连接Redis服务器(redis.conf 文件配置没有生效导致redis运行报错Error: Connection reset by peer)
参考此链接配置 redis.conf,然后本文章才能继续操作 EditPlus连接Centos7修改Redis配置文件(建议FinalShell修改更加方便)https://blog.csdn.net ...
- 解决Redis报错Redis is configured to save RDB snapshots, but it is currently not able to persist on disk
Redis报错信息 在Spring Boot中集成Redis客户之后,进行数据操作,发现报如下错误: org.springframework.data.redis.RedisSystemExcepti ...
- Celery 启动报错 can_read() got an unexpected keyword argument timeout
问题: Celery 启动报错 can_read() got an unexpected keyword argument timeout 方案:更改redis版本和celery版本,我使用下面的ce ...
- SpringBoot 整合Redis报错:NoClassDefFoundError: redis/clients/util/SafeEncoder
QUESTION:SpringBoot 整合Redis报错:NoClassDefFoundError: redis/clients/util/SafeEncoder? ANSWER: 这种情况是版本不 ...
- 解决Redis报错:MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist
解决Redis报错:MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on ...
- 一次redis连接配置修改引发的redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.异常
一次redis连接配置修改引发的redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.异常 ...
最新文章
- Python Module_pdb_DEBUG 方法
- HDU2102 A计划
- spring 使用XML配置开发Spring AOP
- 6个方便的Git Bash脚本
- 感想2-对于组件化的一些思考
- php常用技术与thinkphp5,thinkPHP5框架路由常用知识点汇总
- teamviewer开通防火墙策略
- Kettle构建Hadoop ETL实践(一):ETL与Kettle
- 未能在sysindexes中找到数据库ID11中对象ID1的索引ID1对应的行,请对sysindexes运行
- php AES加解密
- speedoffice被隐藏的工作表如何取消隐藏
- 【C语言】剖析函数递归(3)
- css 三角角标样式
- 经典!沐风老师3DMAX建模实例系列教程上线啦。。。
- 【Cesium】加载互联网地图服务——天地图
- 公司用户画像项目总结
- css 动画时钟 时分秒
- pytorch,torch,torchvision的gpu版本安装避坑
- AppTransition
- TSP-爬山算法求解