redis报错:jedis connection exception unexpected end of stream
来源:互联网 发布:矩阵加常数 编辑:程序博客网 时间:2024/06/08 19:03
一般的话,原因是你在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 ”回到部分
0 0
- redis报错:jedis connection exception unexpected end of stream
- jedis 的 Unexpected end of stream 解决方案
- Unexpected end of stream.
- okhttp的坑坑坑 unexpected end of stream on Connection
- android: unexpected end of stream
- onFailure unexpected end of stream
- Android Download: unexpected end of stream
- JAVA_SAE_Fatal_error: Unexpected end of ZLIB input stream
- Unexpected end of ZLIB input stream
- java.io.IOException: unexpected end of stream
- java.net.ProtocolException: unexpected end of stream
- unexpected end of stream on okhttp3.
- Jedis 连接 Redis 客户端 报错 Connection Refused
- 浏览器报错:unexpected end of input 解决方法
- 报错:illegal invocation,错误:Unexpected end of JSON input
- php报错 syntax error: unexpected end of file
- java.io.EOFException: Unexpected end of ZLIB input stream
- unexpected end of stream on okhttp3.Address 错误原因
- Your project contains error(s),please fix them before running your application解决办法
- Docker网络配置(三)
- 微信支付的那些坑!
- mysql Unknown system variable 'language'
- Android自动化测试MonkeyRunner(二)------第一个示例
- redis报错:jedis connection exception unexpected end of stream
- lucene学习之近实时搜索
- 科研论文阅读与写作实战技巧
- 数据结构复习总结
- Android学习第二课
- jquery.dataTables的使用方法
- 老戚的黑科技之ssh无密码登录
- Spring中基于Schema的AOP配置详解
- 【java】使用Stanford CoreNLP处理英文(词性标注/词形还原/解析等)