调用微信小程序推送订阅消息报错:
java.lang.NullPointerException: null
at cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl.getAccessToken(BaseWxMaServiceImpl.java:173)
at cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl.executeInternal(BaseWxMaServiceImpl.java:290)
at cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl.execute(BaseWxMaServiceImpl.java:253)
at cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl.post(BaseWxMaServiceImpl.java:227)
at cn.binarywang.wx.miniapp.api.impl.WxMaMsgServiceImpl.sendSubscribeMsg(WxMaMsgServiceImpl.java:36)
我也遇到同样的问题,值都有,能正常授权登录,调用发送订阅消息的时候就报这个错误。求解
WxMaProperties.Config userConfig = wxMaProperties.getConfigs().get(1); WxMaSubscribeMessage subscribeMessageToUserReq = getWxMaSubscribeMessageToUser(tOrder, userConfig.getSendPayResultTemplateId()); subscribeMessageToUserReq.setToUser(getRealWxOpenid(userAppExt.getWechatOpenid())); subscribeMessageToUserReq.setPage(sysConfigService.selectConfigByKey(SysConfigConstants.WX_USER_SHARE_ORDERPAGE)); wxMaService.getMsgService().sendSubscribeMsg(subscribeMessageToUserReq);参数都有值