{"record":{"id":"fbc0f16468f29580","repo":"dromara/Sa-Token","slug":"username-password","errorCode":null,"errorMessage":"注解参数配置错误，格式应如：username:password","messagePattern":"注解参数配置错误，格式应如：username:password","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"sa-token-core/src/main/java/cn/dev33/satoken/annotation/handler/SaCheckHttpDigestHandler.java","lineNumber":48,"sourceCode":" */\npublic class SaCheckHttpDigestHandler implements SaAnnotationHandlerInterface<SaCheckHttpDigest> {\n\n    @Override\n    public Class<SaCheckHttpDigest> getHandlerAnnotationClass() {\n        return SaCheckHttpDigest.class;\n    }\n\n    @Override\n    public void checkMethod(SaCheckHttpDigest at, AnnotatedElement element) {\n        _checkMethod(at.username(), at.password(), at.realm(), at.value());\n    }\n\n    public static void _checkMethod(String username, String password, String realm, String value) {\n        // 如果配置了 value，则以 value 优先\n        if(SaFoxUtil.isNotEmpty(value)){\n            String[] arr = value.split(\":\");\n            if(arr.length != 2){\n                throw new SaTokenException(\"注解参数配置错误，格式应如：username:password\");\n            }\n            SaHttpDigestUtil.check(arr[0], arr[1]);\n            return;\n        }\n\n        // 如果配置了 username，则分别获取参数\n        if(SaFoxUtil.isNotEmpty(username)){\n            SaHttpDigestUtil.check(username, password, realm);\n            return;\n        }\n\n        // 都没有配置，则根据全局配置参数进行校验\n        SaHttpDigestUtil.check();\n    }\n\n}","sourceCodeStart":30,"sourceCodeEnd":64,"githubUrl":"https://github.com/dromara/Sa-Token/blob/ac2c7f6e94a78573cf0bcb932dd8b04e68fad189/sa-token-core/src/main/java/cn/dev33/satoken/annotation/handler/SaCheckHttpDigestHandler.java#L30-L64","documentation":"Startup-time fatal check in the (servlet-style reactive naming aside) sa-token-reactor-spring-boot-starter: its constructor reads SpringBootVersion.getVersion() and, if the running Spring Boot is 3.x or 4.x (anything not 1.x/2.x/empty), it throws SaTokenException telling you this starter artifact is only for Spring Boot 2. The class exists to fail fast instead of crashing later with NoSuchMethodError/ClassNotFoundException on Spring 6+ internals.","triggerScenarios":"Including the Maven/Gradle artifact sa-token-reactor-spring-boot-starter on the classpath of an application whose Spring Boot version starts with 3. or 4.; the bean is instantiated during context startup and immediately throws, with the same message also printed to stderr.","commonSituations":"Upgrading a WebFlux project from Spring Boot 2 to 3/4 while keeping the old sa-token starter dependency; using a BOM or starter-parent that silently bumps Spring Boot; copying an old dependency block from a tutorial into a new project.","solutions":["Replace the dependency sa-token-reactor-spring-boot-starter with sa-token-reactor-spring-boot3-starter (or the -boot4- variant for Spring Boot 4) and rebuild","Verify the new artifact version matches your Sa-Token version (check the sa-token compatibility table for Spring Boot 3/4 support, 1.34+ provides boot3 starters)","After switching, confirm no other sa-token *-spring-boot-starter (non-boot3) artifacts remain transitively on the classpath (mvn dependency:tree | grep sa-token)"],"exampleFix":"<!-- before -->\n<dependency>\n    <groupId>cn.dev33</groupId>\n    <artifactId>sa-token-reactor-spring-boot-starter</artifactId>\n    <version>1.38.0</version>\n</dependency>\n\n<!-- after -->\n<dependency>\n    <groupId>cn.dev33</groupId>\n    <artifactId>sa-token-reactor-spring-boot3-starter</artifactId>\n    <version>1.38.0</version>\n</dependency>","handlingStrategy":"validation","validationCode":"// fail in CI/build, not at app startup\nString v = org.springframework.boot.SpringBootVersion.getVersion();\nif (v != null && !v.startsWith(\"1.\") && !v.startsWith(\"2.\")) {\n    throw new IllegalStateException(\"Use sa-token-reactor-spring-boot3/4-starter, not sa-token-reactor-spring-boot-starter\");\n}","typeGuard":null,"tryCatchPattern":"Not applicable: the exception is thrown from a bean constructor during startup; catching it only masks a guaranteed-broken classpath — fix the dependency instead","preventionTips":["Pin sa-token starters matching your Spring Boot major version in the parent POM / version catalog","Add a dependency-enforcement rule (maven-enforcer) banning cn.dev33 legacy starters on Boot 3/4 projects","Re-check dependency:tree for sa-token after any Spring Boot upgrade"],"tags":["spring-boot","version-mismatch","reactor","webflux","classpath","startup"],"backgroundTag":null,"analyzedSha":"ac2c7f6e94a78573cf0bcb932dd8b04e68fad189","analyzedAt":"2026-08-14T14:36:10.271Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}