binarywang/WxJava · error · WxErrorException

-99

-99

Error message

会话存档secret未配置

What it means

Error "会话存档secret未配置" thrown in binarywang/WxJava.

Source

Thrown at weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpServiceJoddHttpImpl.java:123

  }

  @Override
  public String getMsgAuditAccessToken(boolean forceRefresh) throws WxErrorException {
    if (!this.configStorage.isMsgAuditAccessTokenExpired() && !forceRefresh) {
      return this.configStorage.getMsgAuditAccessToken();
    }

    Lock lock = this.configStorage.getMsgAuditAccessTokenLock();
    lock.lock();
    try {
      // 拿到锁之后,再次判断一下最新的token是否过期,避免重刷
      if (!this.configStorage.isMsgAuditAccessTokenExpired() && !forceRefresh) {
        return this.configStorage.getMsgAuditAccessToken();
      }
      // 使用会话存档secret获取access_token
      String msgAuditSecret = this.configStorage.getMsgAuditSecret();
      if (msgAuditSecret == null || msgAuditSecret.trim().isEmpty()) {
        throw new WxErrorException("会话存档secret未配置");
      }
      HttpRequest request = HttpRequest.get(String.format(this.configStorage.getApiUrl(WxCpApiPathConsts.GET_TOKEN),
        this.configStorage.getCorpId(), msgAuditSecret));
      if (this.httpProxy != null) {
        httpClient.useProxy(this.httpProxy);
      }
      request.withConnectionProvider(httpClient);
      HttpResponse response = request.send();

      String resultContent = response.bodyText();
      WxError error = WxError.fromJson(resultContent, WxType.CP);
      if (error.getErrorCode() != 0) {
        throw new WxErrorException(error);
      }
      WxAccessToken accessToken = WxAccessToken.fromJson(resultContent);
      this.configStorage.updateMsgAuditAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
    } finally {
      lock.unlock();

View on GitHub (pinned to 1c43293a3c)

Solutions

  1. 在企业微信多实例配置中补充会话存档 secret(msgAuditSecret),确保与实际会话存档应用匹配。
  2. 确认使用了正确的 WxCpService 实现并加载了包含会话存档 secret 的配置。

When it happens

Trigger: Thrown at weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpServiceJoddHttpImpl.java:123 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of binarywang/WxJava@1c43293a3c (2026-08-14). Data as JSON: /api/errors/50a5fb9774e3bd7f. Report an issue: GitHub.