{"record":{"id":"824319af37011961","repo":"binarywang/WxJava","slug":"appid-824319","errorCode":null,"errorMessage":"微信开放平台 appId 不能为空","messagePattern":"微信开放平台 appId 不能为空","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/configuration/services/AbstractWxOpenConfiguration.java","lineNumber":98,"sourceCode":"      wxOpenService = new WxOpenServiceApacheHttpClientImpl();\n    } else {\n      wxOpenService = new WxOpenServiceHttpComponentsImpl();\n    }\n    wxOpenService.setWxOpenConfigStorage(configStorage);\n    return wxOpenService;\n  }\n\n  private void configApp(WxOpenInMemoryConfigStorage config, WxOpenSingleProperties appProperties) {\n    String appId = appProperties.getAppId();\n    String secret = appProperties.getSecret();\n    String token = appProperties.getToken();\n    String aesKey = appProperties.getAesKey();\n    String apiHostUrl = appProperties.getApiHostUrl();\n    String accessTokenUrl = appProperties.getAccessTokenUrl();\n\n    // appId 和 secret 是必需的\n    if (StringUtils.isBlank(appId)) {\n      throw new IllegalArgumentException(\"微信开放平台 appId 不能为空\");\n    }\n    if (StringUtils.isBlank(secret)) {\n      throw new IllegalArgumentException(\"微信开放平台 secret 不能为空\");\n    }\n\n    config.setComponentAppId(appId);\n    config.setComponentAppSecret(secret);\n    if (StringUtils.isNotBlank(token)) {\n      config.setComponentToken(token);\n    }\n    if (StringUtils.isNotBlank(aesKey)) {\n      config.setComponentAesKey(aesKey);\n    }\n    // 设置URL配置\n    config.setApiHostUrl(StringUtils.trimToNull(apiHostUrl));\n    config.setAccessTokenUrl(StringUtils.trimToNull(accessTokenUrl));\n  }\n","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/binarywang/WxJava/blob/1c43293a3c2c9d7e91304b6d037fb017f680d0c6/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/configuration/services/AbstractWxOpenConfiguration.java#L80-L116","documentation":"Thrown by `configApp` in the Spring Boot multi-account Open Platform starter when a tenant's `appId` (componentAppId) is blank. appId is mandatory for an Open Platform component. It is an IllegalArgumentException, distinct from the RuntimeException uniqueness check.","triggerScenarios":"An entry under `wx.open.apps` whose `appId` is missing, empty, or whitespace, being wired into a WxOpenInMemoryConfigStorage.","commonSituations":"Forgot to set componentAppId; used the wrong property key (e.g. `componentAppId` instead of `appId`); env-var placeholder resolved to empty.","solutions":["Set a non-blank `appId` on the offending open-platform tenant entry.","Check property name spelling and any `${ENV}` resolution.","Restart after fixing."],"exampleFix":"# before\nwx.open.apps:\n  tenant-a: { secret: xxxx }   # appId missing -> throws\n# after\nwx.open.apps:\n  tenant-a: { appId: wxopen001, secret: xxxx }","handlingStrategy":"validation","validationCode":"// Open multi: assert appId present per tenant before bean creation\nfor (WxOpenSingleProperties p : appsMap.values()) {\n    if (StringUtils.isBlank(p.getAppId())) {\n        throw new IllegalArgumentException(\"Open platform appId is required for tenant\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make appId+secret required fields in your config DTO.","Resolve env var placeholders before validation.","Add a startup health check for open-platform credentials."],"tags":["config","open","spring-boot","validation","startup"],"backgroundTag":null,"analyzedSha":"1c43293a3c2c9d7e91304b6d037fb017f680d0c6","analyzedAt":"2026-08-14T02:29:11.060Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}