{"record":{"id":"97152f3e4c06663d","repo":"theonedev/onedev","slug":"exception-e-getmessage-occurred-during-valid","errorCode":null,"errorMessage":"Exception '{e.getMessage()}' occurred during validation {validator.getClass().getName()} on component {getPath()}","messagePattern":"Exception '(.+?)' occurred during validation (.+?) on component (.+?)","errorType":"validation","errorClass":"org.apache.wicket.WicketRuntimeException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java","lineNumber":1581,"sourceCode":"\t\t\tif (behavior instanceof ValidatorAdapter)\n\t\t\t{\n\t\t\t\tvalidator = ((ValidatorAdapter<T>)behavior).getValidator();\n\t\t\t}\n\t\t\telse if (behavior instanceof IValidator)\n\t\t\t{\n\t\t\t\tvalidator = (IValidator<T>)behavior;\n\t\t\t}\n\t\t\tif (validator != null)\n\t\t\t{\n\t\t\t\tif (isNull == false || validator instanceof INullAcceptingValidator<?>)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tvalidator.validate(validatable);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new WicketRuntimeException(\"Exception '\" + e.getMessage() +\n\t\t\t\t\t\t\t\t\"' occurred during validation \" + validator.getClass().getName() +\n\t\t\t\t\t\t\t\t\" on component \" + getPath(), e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isValid())\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Creates an IValidatable that can be used to validate this form component. This validatable\n\t * incorporates error key lookups that correspond to this form component.\n\t * \n\t * This method is useful when validation needs to happen outside the regular validation workflow\n\t * but error messages should still be properly reported against the form component.","sourceCodeStart":1563,"sourceCodeEnd":1599,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java#L1563-L1599","documentation":"Wicket FormComponent.validate wraps any exception thrown by an attached IValidator into a WicketRuntimeException carrying the component path and validator class; it signals a validator crashed (a bug in the validator or bad input handling), not a normal validation failure.","triggerScenarios":"Thrown at server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java:1581 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped cause to find the failing validator and fix its implementation.","Ensure validators throw ValidationError rather than raw exceptions on invalid input."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}