binarywang/WxJava · error · WxRuntimeException
微信服务端异常,超出重试次数
Error message
微信服务端异常,超出重试次数
What it means
Error "微信服务端异常,超出重试次数" thrown in binarywang/WxJava.
Source
Thrown at weixin-java-cp/src/main/java/me/chanjar/weixin/cp/corpgroup/service/impl/BaseWxCpCgServiceImpl.java:153
* @param <E> the type parameter
* @param executor the executor
* @param uri the uri
* @param data the data
* @param withoutCorpAccessToken the without Corp access token
* @param req 获取token请求参数
* @return the t
* @throws WxErrorException the wx error exception
*/
public <T, E> T execute(RequestExecutor<T, E> executor, String uri, E data, boolean withoutCorpAccessToken, WxCpCorpGroupCorpGetTokenReq req) throws WxErrorException {
int retryTimes = 0;
do {
try {
return this.executeInternal(executor, uri, data, withoutCorpAccessToken, req);
} catch (WxErrorException e) {
if (retryTimes + 1 > this.maxRetryTimes) {
log.warn("重试达到最大次数【{}】", this.maxRetryTimes);
//最后一次重试失败后,直接抛出异常,不再等待
throw new WxRuntimeException("微信服务端异常,超出重试次数");
}
WxError error = e.getError();
/*
* -1 系统繁忙, 1000ms后重试
*/
if (error.getErrorCode() == -1) {
int sleepMillis = this.retrySleepMillis * (1 << retryTimes);
try {
log.debug("微信系统繁忙,{} ms 后重试(第{}次)", sleepMillis, retryTimes + 1);
Thread.sleep(sleepMillis);
} catch (InterruptedException e1) {
Thread.currentThread().interrupt();
}
} else {
throw e;
}
}View on GitHub (pinned to 1c43293a3c)
Solutions
- 检查网络稳定性,适当增大重试次数或超时时间配置。
- 确认请求参数正确,排除微信服务端持续报错(如 access_token 失效)导致重试无效。
When it happens
Trigger: Thrown at weixin-java-cp/src/main/java/me/chanjar/weixin/cp/corpgroup/service/impl/BaseWxCpCgServiceImpl.java:153 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/e18fa5af9ccdac75.
Report an issue: GitHub.