flowable/flowable-engine · error · FlowableIllegalArgumentException

Field definition uses non-existent field '${name}' of class

Error message

Field definition uses non-existent field '${name}' of class ${target.getClass().getName()}

What it means

ReflectUtil.invokeSetterOrField injects a value into a target object via a setter or direct field. When no setter exists, the matching field cannot be found on the target class, and throwExceptionOnMissingField is true, it throws this FlowableIllegalArgumentException naming the missing field and class.

Source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/util/ReflectUtil.java:173

            Method method = findMethod(clazz, methodName, args);
            method.setAccessible(true);
            return method.invoke(target, args);
        } catch (Exception e) {
            throw new FlowableException("couldn't invoke " + methodName + " on " + target, e);
        }
    }
    
    public static void invokeSetterOrField(Object target, String name, Object value, boolean throwExceptionOnMissingField) {
        Method setterMethod = getSetter(name, target.getClass(), value.getClass());

        if (setterMethod != null) {
            invokeSetter(setterMethod, target, name, value);
            
        } else {
            Field field = ReflectUtil.getField(name, target);
            if (field == null) {
                if (throwExceptionOnMissingField) {
                    throw new FlowableIllegalArgumentException("Field definition uses non-existent field '" + name + "' of class " + target.getClass().getName());
                } else {
                    return;
                }
            }

            // Check if the delegate field's type is correct
            if (!fieldTypeCompatible(value, field)) {
                throw new FlowableIllegalArgumentException("Incompatible type set on field declaration '" + name
                        + "' for class " + target.getClass().getName()
                        + ". Declared value has type " + value.getClass().getName()
                        + ", while expecting " + field.getType().getName());
            }
            
            setField(field, target, value);
        }
    }

    /**

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify the field name spelling matches a field declared on the target class (or superclass).
  2. Add the field or a setter with the configured name to the delegate class.
  3. Update the process definition / configuration to use the renamed field.
  4. If the field is genuinely optional, call with throwExceptionOnMissingField=false (when using the API directly).
  5. Deploy the updated delegate class together with the corrected process definition.

Example fix

// before
<flowable:field name="recipiants"> <!-- typo -->
// after
<flowable:field name="recipients"> <!-- matches delegate field -->
Defensive patterns

Strategy: validation

Validate before calling

boolean exists = false;
try { target.getClass().getDeclaredField(name); exists = true; }
catch (NoSuchFieldException ignored) { }
if (!exists && java.util.Arrays.stream(target.getClass().getMethods()).noneMatch(m -> m.getName().equalsIgnoreCase("set" + name)))
    throw new IllegalStateException("No field/setter " + name + " on " + target.getClass().getName());

Try / catch

try {
    ReflectUtil.invokeSetterOrField(target, name, value, true);
} catch (FlowableIllegalArgumentException e) {
    LOGGER.error("Field injection misconfigured: {}", e.getMessage());
    throw new DeploymentConfigurationException(e.getMessage(), e);
}

Prevention

When it happens

Trigger: Calling invokeSetterOrField(target, name, value, true) where the target class (and superclasses) define neither a setter nor a field with that name; in Flowable, class-level field injection in process definitions (flowable:field) referencing a property that doesn't exist on the delegate class.

Common situations: Typo in field name in BPMN XML <flowable:field name="...">; delegate class refactored/renamed a field after the process definition was authored; injecting a field into a class that expects constructor/setter injection instead.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/e7c3b9532115ae1c. Report an issue: GitHub.