jetcache CacheUtil偶现空指针异常

vojdkbi0  于 3个月前  发布在  其他
关注(0)|答案(1)|浏览(70)

jetcache版本:2.6.0
spring版本:5.2.10.RELEASE.jar
spring-boot版本:2.3.5.RELEASE
redis使用sentinel部署方式

线上运行中偶现报空指针,偶现且无法稳定复现,报错频率还挺高。整个工程未使用jetcache的computeIfAbsent方法,只使用了jetcache注解做3级缓存
例如

@Cached(name = "xxx", key = "#id", expire = 3600, cacheType = CacheType.BOTH)

错误堆栈

Caused by: java.lang.NullPointerException
at com.alicp.jetcache.CacheUtil.lambda$createProxyLoader$0(CacheUtil.java:82) ~[jetcache-core-2.6.0.jar!/:?]
at com.alicp.jetcache.CacheLoader.apply(CacheLoader.java:31) ~[jetcache-core-2.6.0.jar!/:?]
at com.alicp.jetcache.AbstractCache.computeIfAbsentImpl(AbstractCache.java:178) ~[jetcache-core-2.6.0.jar!/:?]
at com.alicp.jetcache.RefreshCache.computeIfAbsent(RefreshCache.java:58) ~[jetcache-core-2.6.0.jar!/:?]
at com.alicp.jetcache.RefreshCache.computeIfAbsent(RefreshCache.java:53) ~[jetcache-core-2.6.0.jar!/:?]
at com.alicp.jetcache.anno.method.CacheHandler.invokeWithCached(CacheHandler.java:250) ~[jetcache-anno-2.6.0.jar!/:?]
at com.alicp.jetcache.anno.method.CacheHandler.doInvoke(CacheHandler.java:93) ~[jetcache-anno-2.6.0.jar!/:?]
at com.alicp.jetcache.anno.method.CacheHandler.invoke(CacheHandler.java:85) ~[jetcache-anno-2.6.0.jar!/:?]
at com.alicp.jetcache.anno.aop.JetCacheInterceptor.invoke(JetCacheInterceptor.java:80) ~[jetcache-anno-2.6.0.jar!/:?]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.10.RELEASE.jar!/:5.2.10.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.10.RELEASE.jar!/:5.2.10.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) ~[spring-aop-5.2.10.RELEASE.jar!/:5.2.10.RELEASE]
krcsximq

krcsximq1#

信息不足,无法判断。这个版本太老了,你可以升级一下看看,第三位小版本号的升级都是兼容的。

你升2.7也可以,可能要指定一下jedis的版本。

版本兼容性看这里: https://github.com/alibaba/jetcache/blob/master/docs/CN/Compatibility.md

相关问题