-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
weixin-java-miniapp使用WxMaRedisConfigImpl存储token时,报空指针 #1198
Comments
|
#1100 @winter4666 有空帮忙看下吧,这个类应该是你实现的。 |
看你贴的异常信息:
是 try (Jedis jedis = jedisPool.getResource()) { 初步判定是你使用 |
我已经加了断点远程调试了,就是在getExpireFromRedis报错的,这个时候redis里面并没有expire的值,setJedisPool我肯定是set的,不然运行都运行不起来
|
下面是 private long getExpireFromRedis(String key) {
try (Jedis jedis = jedisPool.getResource()) {
String expire = jedis.hget(getRedisKey(key), HASH_EXPIRE_FIELD);
return expire == null ? 0 : Long.parseLong(expire);
}
} 可以看到这一行 |
看了你的代码,确实如你说的,我再断点看下 |
简要描述
weixin-java-miniapp使用WxMaRedisConfigImpl存储token时,启动后第一次调用WxMaServiceImpl的getAccessToken报空指针
模块版本情况
详细描述
使用WxMaRedisConfigImpl存储redis时,如果是启动后第一次调用WxMaServiceImpl的getAccessToken方法时,会报空指针,我看WxMpInRedisConfigStorage是用redis的ttl过期时间来处理的,即使是没有设置也不会返回空指针,会返回int值。WxMaRedisConfigImpl是单独设置了一个key,value,猜想第一次的时候没有设置expire,所以会报空指针。(accessToken值已写入redis)
另外顺带问下WxMaRedisConfigImpl支持多个小程序么,因为看redis中存储的结构也和WxMpInRedisConfigStorage不同
日志
https://paste.ubuntu.com/p/kMR848v6WQ/
The text was updated successfully, but these errors were encountered: