{"record":{"id":"dd61b22615e0503a","repo":"dromara/Sa-Token","slug":"sa-token-redis-xxx-alone-redis-dd61b2","errorCode":null,"errorMessage":"未引入 sa-token-redis-xxx 相关插件，或引入的插件不在 Alone-Redis 支持范围内","messagePattern":"未引入 sa-token-redis-xxx 相关插件，或引入的插件不在 Alone-Redis 支持范围内","errorType":"exception","errorClass":"SaTokenException","httpStatus":null,"severity":"critical","filePath":"sa-token-plugin/sa-token-alone-redis/src/main/java/cn/dev33/satoken/dao/alone/SaAloneRedisInject.java","lineNumber":232,"sourceCode":"\t\t\t\tClass.forName(\"cn.dev33.satoken.dao.SaTokenDaoForRedisTemplateUseJdkSerializer\");\n\t\t\t\tSaTokenDaoForRedisTemplateUseJdkSerializer dao = (SaTokenDaoForRedisTemplateUseJdkSerializer)saTokenDao;\n\t\t\t\tdao.isInit = false;\n\t\t\t\tdao.init(factory);\n\t\t\t\treturn;\n\t\t\t} catch (ClassNotFoundException ignored) {\n\t\t\t}\n\t\t\t// 如果开发者引入的是：sa-token-redis-template\n\t\t\ttry {\n\t\t\t\tClass.forName(\"cn.dev33.satoken.dao.SaTokenDaoForRedisTemplate\");\n\t\t\t\tSaTokenDaoForRedisTemplate dao = (SaTokenDaoForRedisTemplate)saTokenDao;\n\t\t\t\tdao.isInit = false;\n\t\t\t\tdao.init(factory);\n\t\t\t\treturn;\n\t\t\t} catch (ClassNotFoundException ignored) {\n\t\t\t}\n\n\t\t\t// 至此，说明开发者一个 redis 插件也没引入，或者引入的 redis 插件不在 sa-token-alone-redis 的支持范围内\n\t\t\tthrow new SaTokenException(\"未引入 sa-token-redis-xxx 相关插件，或引入的插件不在 Alone-Redis 支持范围内\");\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\t\n\t/**\n\t * 骗过编辑器，增加配置文件代码提示 \n\t * @return 配置对象\n\t */\n\t@ConfigurationProperties(prefix = ALONE_PREFIX)\n\tpublic RedisProperties getSaAloneRedisConfig() {\n\t\treturn new RedisProperties();\n\t}\n\t\n}\n","sourceCodeStart":214,"sourceCodeEnd":249,"githubUrl":"https://github.com/dromara/Sa-Token/blob/ac2c7f6e94a78573cf0bcb932dd8b04e68fad189/sa-token-plugin/sa-token-alone-redis/src/main/java/cn/dev33/satoken/dao/alone/SaAloneRedisInject.java#L214-L249","documentation":"SaTokenException thrown by the legacy sa-token-alone-redis plugin when re-binding the separately-configured redis connection to the active SaTokenDao: it Class.forName-probes known dao implementations (ending with SaTokenDaoForRedisTemplate here), and if none loads, no supported sa-token-redis plugin is on the classpath. Identical semantics to error 113 but in the non-boot4 injector; the outer catch prints the stack trace rather than propagating cleanly.","triggerScenarios":"Using sa-token-alone-redis without a companion redis dao dependency (e.g. missing sa-token-redis-template / sa-token-redis-jackson etc. matching the probed class names), or with mismatched sa-token versions where the dao implementation class was relocated/renamed.","commonSituations":"Docs walkthrough that mentions alone-redis but omits the base redis plugin dependency; partial upgrades where sa-token-core version differs from the redis plugin version.","solutions":["Add the matching sa-token-redis plugin dependency and pin all sa-token artifacts to one version.","Verify with mvn dependency:tree that the dao class (e.g. cn.dev33.satoken.dao.SaTokenDaoForRedisTemplate) is actually on the runtime classpath.","Check the printed stack trace at startup to distinguish this failure from an earlier connection error.","If your dao is custom, wire the alone-redis factory into it yourself instead of relying on the injector's probing."],"exampleFix":"# before: only sa-token-alone-redis in pom\n\n# after: add the dao plugin\n<dependency>\n  <groupId>cn.dev33</groupId>\n  <artifactId>sa-token-redis-template</artifactId>\n  <version>${sa-token.version}</version>\n</dependency>","handlingStrategy":"validation","validationCode":"// CI/startup check for the legacy plugin\nClass.forName(\"cn.dev33.satoken.dao.SaTokenDaoForRedisTemplate\");\n// and verify dependency:tree shows a sa-token-redis-* artifact at the same version","typeGuard":null,"tryCatchPattern":null,"preventionTips":["alone-redis is an add-on, never standalone: always pair it with its base redis dao dependency.","After any sa-token upgrade, rerun a minimal boot test that exercises the alone-redis injector."],"tags":["alone-redis","dependency-missing","sa-token-dao","legacy-plugin"],"backgroundTag":null,"analyzedSha":"ac2c7f6e94a78573cf0bcb932dd8b04e68fad189","analyzedAt":"2026-08-14T14:36:10.271Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}