当前位置:   article > 正文

RedisSystemException: Redis exception; nested exception is io.lettuce.core.RedisException: java.lang_org.springframework.data.redis.redissystemexceptio

org.springframework.data.redis.redissystemexception: redis exception; nested

异常信息如下:

org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is io.lettuce.core.RedisException: java.lang.NullPointerException

生产上有个A服务在运行了一段时间后就开始报以下异常信息,同时连接词redis的其他服务都没有异常,只有A服务报此异常,异常完整信息如下、

org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is io.lettuce.core.RedisException: java.lang.NullPointerException
	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:273)
	at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.convertLettuceAccessException(LettuceStringCommands.java:799)
	at 
	//开始报错的位置
	org.springframework.data.redis.connection.lettuce.LettuceStringCommands.get(LettuceStringCommands.java:68)
	at org.springframework.data.redis.connection.DefaultedRedisConnection.get(DefaultedRedisConnection.java:266)
	at org.springframework.data.redis.core.DefaultValueOperations$1.inRedis(DefaultValueOperations.java:57)
	at org.springframework.data.redis.core.AbstractOperations$ValueDeserializingRedisCallback.doInRedis(AbstractOperations.java:60)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:228)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:188)
	at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:96)
	at org.springframework.data.redis.core.DefaultValueOperations.get(DefaultValueOperations.java:53)
	//自己的代码获取redis的key开始
	at com.mystest.common.redis.service.RedisService.getCacheObject(RedisService.java:79)

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

报错源码分析:

在这里插入图片描述
可以看到报出的空指针错误是由由于69、63或66行获取连接时没有返回导致获取key直接报出了空指针异常。
为什么获取连接没获取到,但是同时其他服务都没有问题,可能是由于服务连接redis超过的了最大连接,之前的链接一直没有释放。

解决办法

是将链接redis报错的服务进行了重启,重启后就没有报错可以正常链接redis了。

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号