{"record":{"id":"50a5fb9774e3bd7f","repo":"binarywang/WxJava","slug":"99-50a5fb","errorCode":"-99","errorMessage":"会话存档secret未配置","messagePattern":"会话存档secret未配置","errorType":"validation","errorClass":"WxErrorException","httpStatus":null,"severity":"error","filePath":"weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpServiceJoddHttpImpl.java","lineNumber":123,"sourceCode":"  }\n\n  @Override\n  public String getMsgAuditAccessToken(boolean forceRefresh) throws WxErrorException {\n    if (!this.configStorage.isMsgAuditAccessTokenExpired() && !forceRefresh) {\n      return this.configStorage.getMsgAuditAccessToken();\n    }\n\n    Lock lock = this.configStorage.getMsgAuditAccessTokenLock();\n    lock.lock();\n    try {\n      // 拿到锁之后，再次判断一下最新的token是否过期，避免重刷\n      if (!this.configStorage.isMsgAuditAccessTokenExpired() && !forceRefresh) {\n        return this.configStorage.getMsgAuditAccessToken();\n      }\n      // 使用会话存档secret获取access_token\n      String msgAuditSecret = this.configStorage.getMsgAuditSecret();\n      if (msgAuditSecret == null || msgAuditSecret.trim().isEmpty()) {\n        throw new WxErrorException(\"会话存档secret未配置\");\n      }\n      HttpRequest request = HttpRequest.get(String.format(this.configStorage.getApiUrl(WxCpApiPathConsts.GET_TOKEN),\n        this.configStorage.getCorpId(), msgAuditSecret));\n      if (this.httpProxy != null) {\n        httpClient.useProxy(this.httpProxy);\n      }\n      request.withConnectionProvider(httpClient);\n      HttpResponse response = request.send();\n\n      String resultContent = response.bodyText();\n      WxError error = WxError.fromJson(resultContent, WxType.CP);\n      if (error.getErrorCode() != 0) {\n        throw new WxErrorException(error);\n      }\n      WxAccessToken accessToken = WxAccessToken.fromJson(resultContent);\n      this.configStorage.updateMsgAuditAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());\n    } finally {\n      lock.unlock();","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/binarywang/WxJava/blob/1c43293a3c2c9d7e91304b6d037fb017f680d0c6/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpServiceJoddHttpImpl.java#L105-L141","documentation":"Error \"会话存档secret未配置\" thrown in binarywang/WxJava.","triggerScenarios":"Thrown at weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpServiceJoddHttpImpl.java:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["在企业微信多实例配置中补充会话存档 secret（msgAuditSecret），确保与实际会话存档应用匹配。","确认使用了正确的 WxCpService 实现并加载了包含会话存档 secret 的配置。"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1c43293a3c2c9d7e91304b6d037fb017f680d0c6","analyzedAt":"2026-08-14T02:29:11.060Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}