spring-redis报broken pipe错误
如题,启动项目后,过个10几分钟就报错:
org.springframework.data.redis.RedisConnectionFailureException:
java.net.SocketException: Broken pipe;
nested exception is redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe。。。。。
版本:spring-data-redis-1.7.1.RELEASE.jar,jedis-2.8.1.jar(jedis-2.4.2.jar也试过)
配置xml为
<bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxIdle" value="5" />
<property name="maxTotal" value="10" />
<property name="testOnBorrow" value="true" />
</bean>
<bean id="connectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:timeout="10000"
p:host-name="${redis.host}" p:port="${redis.port}" p:password="${redis.pass}" p:pool-config-ref="poolConfig"/>
<bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<property name="enableTransactionSupport" value="${redis.transactionSupport}" />
</bean>
参考网上的换版本等解决方法,都没有解决问题,求高手解惑
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
后来没用spring去管理redis
老哥你这解决了吗 ???我也遇见了这个问题,不知道怎么解决。求解,谢谢!
试一试不启用事务的话了?你这边最后是如何解决的最后?
org.springframework.data.redis.RedisConnectionFailureException: java.net.SocketException: Broken pipe; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe
at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:67)
at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:41)
at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:37)
at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:37)
at org.springframework.data.redis.connection.jedis.JedisConnection.convertJedisAccessException(JedisConnection.java:212)
at org.springframework.data.redis.connection.jedis.JedisConnection.hMGet(JedisConnection.java:2970)
at org.springframework.data.redis.connection.DefaultStringRedisConnection.hMGet(DefaultStringRedisConnection.java:400)
at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.data.redis.core.CloseSuppressingInvocationHandler.invoke(CloseSuppressingInvocationHandler.java:57)
at com.sun.proxy.$Proxy14.hMGet(Unknown Source)
at com.igen.solarman.command.dao.impl.RedisDAO$5.doInRedis(RedisDAO.java:176)
at com.igen.solarman.command.dao.impl.RedisDAO$5.doInRedis(RedisDAO.java:1)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:191)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:153)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:141)
at com.igen.solarman.command.dao.impl.RedisDAO.hMGet(RedisDAO.java:170)
at com.igen.solarman.command.queue.EventQueueThread.sync(EventQueueThread.java:187)
at com.igen.solarman.command.queue.EventQueueThread.run(EventQueueThread.java:123)
at java.lang.Thread.run(Thread.java:745)
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:98)
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:78)
at redis.clients.jedis.Connection.sendCommand(Connection.java:101)
at redis.clients.jedis.BinaryClient.hmget(BinaryClient.java:253)
at redis.clients.jedis.BinaryJedis.hmget(BinaryJedis.java:813)
at org.springframework.data.redis.connection.jedis.JedisConnection.hMGet(JedisConnection.java:2968)
... 15 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
我看了一下maven仓库,这个版本最低依赖jedis-client2.8.1
http://mvnrepository.com/artifact/org.springframework.data/spring-data-redis/1.7.1.RELEASE
依赖应该都是可以的,我下面再贴了一段错误信息,你可以看看
你看一下你的这个spring-redis的spring依赖版本