{"record":{"id":"187f4a0dfe21cd8d","repo":"theonedev/onedev","slug":"field-not-found-class-classname-field-fie","errorCode":null,"errorMessage":"Field not found (class: ${className}, field: ${fieldName})","messagePattern":"Field not found \\(class: (.+?), field: (.+?)\\)","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/util/ReflectionUtils.java","lineNumber":154,"sourceCode":"\t\t\ttry {\n\t\t\t\treturn current.getDeclaredMethod(methodName, paramTypes);\n\t\t\t} catch (SecurityException e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} catch (NoSuchMethodException e) {\n\t\t\t\t// ignore\n\t\t\t}\n\t\t\tif (current == Object.class)\n\t\t\t\tbreak;\n\t\t\tcurrent = current.getSuperclass();\n\t\t}\n\t\t\n\t\treturn null;\n\t}\n\n\tpublic static void setFieldValue(Object object, String fieldName, Object value) {\n\t\tField field = findField(object.getClass(), fieldName);\n\t\tif (field == null) {\n\t\t\tthrow new ExplicitException(\"Field not found (class: \" + object.getClass().getName() + \", field: \" + fieldName + \")\");\n\t\t}\n\t\tfield.setAccessible(true);\n\t\ttry {\n\t\t\tfield.set(object, value);\n\t\t} catch (IllegalAccessException e) {\n\t\t\tthrow ExceptionUtils.unchecked(e);\n\t\t}\n\t}\n\t\n\t/**\n\t * Find non-static field in specified class hierarchy with specified name.\n\t * <p>\n\t * @param clazz\n\t * \t\t\tclass to search non-static field in. All the super classes will also \n\t * \t\t\tbe consulted if not found in sub class\n\t * @param fieldName\n\t * \t\t\tname of the field to search for\n\t * @return ","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/util/ReflectionUtils.java#L136-L172","documentation":"ReflectionUtils.setFieldValue walks the class hierarchy via findField and throws ExplicitException when the field cannot be located; the message interpolates the class and field names. This indicates a programming/configuration mismatch, not user input error.","triggerScenarios":"Thrown at server-core/src/main/java/io/onedev/server/util/ReflectionUtils.java:154 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the exact field name and target class (inherited fields must exist up the hierarchy).","Use findField and handle a null return when the field is optional."],"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-14T05:17:10.506Z"}