{"record":{"id":"4d2e55adddf548db","repo":"dromara/Sa-Token","slug":"10004","errorCode":"10004","errorMessage":"HTTP 请求处理器未实现","messagePattern":"HTTP 请求处理器未实现","errorType":"exception","errorClass":"NotImplException","httpStatus":null,"severity":"error","filePath":"sa-token-core/src/main/java/cn/dev33/satoken/http/SaHttpTemplateDefaultImpl.java","lineNumber":41,"sourceCode":"/**\n * Http 请求处理器，默认实现类\n * \n * @author click33\n * @since 1.43.0\n */\npublic class SaHttpTemplateDefaultImpl implements SaHttpTemplate {\n\n\tpublic static final String ERROR_MESSAGE = \"HTTP 请求处理器未实现\";\n\n\t/**\n\t * get 请求\n\t *\n\t * @param url /\n\t * @return /\n\t */\n\t@Override\n\tpublic String get(String url) {\n\t\tthrow new NotImplException(ERROR_MESSAGE).setCode(SaErrorCode.CODE_10004);\n\t}\n\n\t/**\n\t * post 请求，form-data 格式参数\n\t */\n\t@Override\n\tpublic String postByFormData(String url, Map<String, Object> params) {\n\t\tthrow new NotImplException(ERROR_MESSAGE).setCode(SaErrorCode.CODE_10004);\n\t}\n\n}\n","sourceCodeStart":23,"sourceCodeEnd":53,"githubUrl":"https://github.com/dromara/Sa-Token/blob/ac2c7f6e94a78573cf0bcb932dd8b04e68fad189/sa-token-core/src/main/java/cn/dev33/satoken/http/SaHttpTemplateDefaultImpl.java#L23-L53","documentation":"SaHttpTemplateDefaultImpl is the placeholder outbound-HTTP implementation registered by sa-token-core. Its get(url) throws NotImplException (code 10004) to signal that no real HTTP client plugin was provided. Features that make server-side HTTP calls (e.g. OAuth2/SSO components fetching tokens or user info) hit this stub when the HTTP integration jar is absent.","triggerScenarios":"An SSO/OAuth2 client flow calls SaHttpTemplate.get(...) while only sa-token-core (or a starter without an http plugin) is on the classpath and SaManager.getSaHttpTemplate() still returns the default impl.","commonSituations":"Adding sa-token-sso but forgetting the httpclient/okhttp plugin dependency; environment without the plugin artifact; startup order where setSaHttpTemplate is called after first use.","solutions":["Add an sa-token HTTP plugin dependency, e.g. sa-token-http-for-httpclient or sa-token-http-for-okhttp, matching your sa-token version","Or register an implementation yourself at startup: SaManager.setSaHttpTemplate(new MySaHttpTemplate()) based on RestTemplate/WebClient/etc.","Verify with SaManager.getSaHttpTemplate().getClass() that it is no longer SaHttpTemplateDefaultImpl before serving traffic"],"exampleFix":"<!-- before: no http plugin -->\n<dependency>\n  <groupId>cn.dev33</groupId>\n  <artifactId>sa-token-sso</artifactId>\n</dependency>\n\n<!-- after -->\n<dependency>\n  <groupId>cn.dev33</groupId>\n  <artifactId>sa-token-sso</artifactId>\n</dependency>\n<dependency>\n  <groupId>cn.dev33</groupId>\n  <artifactId>sa-token-http-for-httpclient</artifactId>\n  <version>1.44.0</version>\n</dependency>","handlingStrategy":"validation","validationCode":"if (SaManager.getSaHttpTemplate() instanceof SaHttpTemplateDefaultImpl) {\n    throw new IllegalStateException(\"Add an sa-token http plugin before SSO flows run\");\n}","typeGuard":null,"tryCatchPattern":"catch (NotImplException e) {\n    if (SaErrorCode.CODE_10004 == e.getCode()) { /* http plugin missing */ }\n}","preventionTips":["Include sa-token-http-for-httpclient/okhttp whenever using SSO/OAuth2 modules","Assert the registered template class at startup","Keep plugin versions locked to the sa-token BOM"],"tags":["sa-token","http-client","sso","oauth2","dependency"],"backgroundTag":null,"analyzedSha":"ac2c7f6e94a78573cf0bcb932dd8b04e68fad189","analyzedAt":"2026-08-14T14:36:10.271Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}