{"record":{"id":"ac684f852040feab","repo":"flowable/flowable-engine","slug":"field-definition-uses-unexisting-field-s-on-cla-ac684f","errorCode":null,"errorMessage":"Field definition uses unexisting field '%s' on class %s","messagePattern":"Field definition uses unexisting field '(.+?)' on class (.+?)","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/helper/ClassDelegateUtil.java","lineNumber":65,"sourceCode":"\n    public static void applyFieldDeclaration(FieldDeclaration declaration, Object target) {\n        Method setterMethod = ReflectUtil.getSetter(declaration.getName(),\n                target.getClass(), declaration.getValue().getClass());\n\n        if (setterMethod != null) {\n            try {\n                setterMethod.invoke(target, declaration.getValue());\n            } catch (IllegalArgumentException e) {\n                throw new ActivitiException(\"Error while invoking '\" + declaration.getName() + \"' on class \" + target.getClass().getName(), e);\n            } catch (IllegalAccessException e) {\n                throw new ActivitiException(\"Illegal access when calling '\" + declaration.getName() + \"' on class \" + target.getClass().getName(), e);\n            } catch (InvocationTargetException e) {\n                throw new ActivitiException(\"Exception while invoking '\" + declaration.getName() + \"' on class \" + target.getClass().getName(), e);\n            }\n        } else {\n            Field field = ReflectUtil.getField(declaration.getName(), target);\n            if (field == null) {\n                throw new ActivitiIllegalArgumentException(\"Field definition uses unexisting field '\" + declaration.getName() + \"' on class \" + target.getClass().getName());\n            }\n            // Check if the delegate field's type is correct\n            if (!fieldTypeCompatible(declaration, field)) {\n                throw new ActivitiIllegalArgumentException(\"Incompatible type set on field declaration '\" + declaration.getName()\n                        + \"' for class \" + target.getClass().getName()\n                        + \". Declared value has type \" + declaration.getValue().getClass().getName()\n                        + \", while expecting \" + field.getType().getName());\n            }\n            ReflectUtil.setField(field, target, declaration.getValue());\n        }\n    }\n\n    public static boolean fieldTypeCompatible(FieldDeclaration declaration, Field field) {\n        if (declaration.getValue() != null) {\n            return field.getType().isAssignableFrom(declaration.getValue().getClass());\n        } else {\n            // Null can be set any field type\n            return true;","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/helper/ClassDelegateUtil.java#L47-L83","documentation":"Thrown when a BPMN field injection (flowable:field) references a field name that does not exist on the delegate class and no matching setter was found. The engine looks the field up via reflection and fails fast with ActivitiIllegalArgumentException.","triggerScenarios":"flowable:field name attribute in the BPMN XML does not match any field or setter on the delegate class resolved for the service task/listener.","commonSituations":"Typo in the field name in the XML; renaming a field/setter in the delegate without updating process XML; copying XML between tasks that use different delegate classes.","solutions":["Correct the flowable:field name attribute to match an existing field or setter on the delegate class","Add the missing field (with public visibility or public setter) to the delegate class","Compare the delegate class name in the XML class attribute against the intended class","Rebuild/redeploy the process definition after fixing"],"exampleFix":"// before\n<flowable:field name=\"retyCount\" stringValue=\"3\"/>\n// after\n<flowable:field name=\"retryCount\" stringValue=\"3\"/>","handlingStrategy":"validation","validationCode":"boolean hasField = java.util.Arrays.stream(delegateClass.getDeclaredFields()).anyMatch(f -> f.getName().equals(\"retryCount\"));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match flowable:field name exactly to a delegate field or setter","Rename fields via refactoring tools that update BPMN XML or grep the XML after renames","Add startup validation of deployed process XML against delegate classes"],"tags":["java","bpmn","field-injection","validation"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}