{"record":{"id":"109df4672a755bda","repo":"paascloud/paascloud-master","slug":"error-109df4","errorCode":null,"errorMessage":"验证码处理器不存在","messagePattern":"验证码处理器不存在","errorType":"validation","errorClass":"ValidateCodeException","httpStatus":400,"severity":"error","filePath":"paascloud-common/paascloud-security-core/src/main/java/com/paascloud/security/core/validate/code/ValidateCodeProcessorHolder.java","lineNumber":61,"sourceCode":"\t *\n\t * @return validate code processor\n\t */\n\tValidateCodeProcessor findValidateCodeProcessor(ValidateCodeType type) {\n\t\treturn findValidateCodeProcessor(type.toString().toLowerCase());\n\t}\n\n\t/**\n\t * Find validate code processor validate code processor.\n\t *\n\t * @param type the type\n\t *\n\t * @return validate code processor\n\t */\n\tValidateCodeProcessor findValidateCodeProcessor(String type) {\n\t\tString name = type.toLowerCase() + ValidateCodeProcessor.class.getSimpleName();\n\t\tValidateCodeProcessor processor = validateCodeProcessors.get(name);\n\t\tif (processor == null) {\n\t\t\tthrow new ValidateCodeException(\"验证码处理器\" + name + \"不存在\");\n\t\t}\n\t\treturn processor;\n\t}\n\n}\n","sourceCodeStart":43,"sourceCodeEnd":67,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-common/paascloud-security-core/src/main/java/com/paascloud/security/core/validate/code/ValidateCodeProcessorHolder.java#L43-L67","documentation":"ValidateCodeProcessorHolder.findValidateCodeProcessor looks up a validate-code processor bean by convention: <type in lowercase> + 'ValidateCodeProcessor' (e.g. 'smsValidateCodeProcessor', 'imageValidateCodeProcessor'). If no such bean is registered in the holder's map, a ValidateCodeException '验证码处理器xxx不存在' is thrown.","triggerScenarios":"POSTing to a validate-code endpoint with a URL/type whose processor was never registered — e.g. /code/xxx where no XxxValidateCodeProcessor bean exists, or a misspelled type in the request path.","commonSituations":"Custom validate-code type added without providing a corresponding processor bean; spring bean scanning excluded the processor's package; typo in the controller's @PathVariable; module providing the processor not on classpath.","solutions":["Verify a @Component processor for that type exists and implements ValidateCodeProcessor","Ensure the processor's package is covered by @ComponentScan / spring.factories configuration","Confirm the requested type in the URL matches the processor's ValidateCodeType (case-insensitive)","Check the application includes paascloud-security-core and its processor auto-configuration"],"exampleFix":"// before\nGET /code/emial  -> typo, no processor 'emialValidateCodeProcessor'\n// after\nGET /code/email  -> matches EmailValidateCodeProcessor bean","handlingStrategy":"validation","validationCode":"String expected = type.toLowerCase() + \"ValidateCodeProcessor\";\nboolean exists = applicationContext.containsBean(expected);","typeGuard":null,"tryCatchPattern":"try { processorHolder.findValidateCodeProcessor(type); } catch (ValidateCodeException e) { return ResponseEntity.badRequest().body(\"不支持的验证码类型: \" + type); }","preventionTips":["Keep processor bean names aligned with the naming convention","Component-scan the package holding all processors","Test each /code/{type} endpoint at startup"],"tags":["validation-code","spring","missing-bean"],"backgroundTag":"resource-not-found","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}