flowable/flowable-engine · error · ActivitiException

Cannot set value of '', it resolves to a bean defined in…

Error message

Cannot set value of '', it resolves to a bean defined in the Spring application-context.

What it means

Thrown by ApplicationContextElResolver.setValue when an EL expression attempts to assign to a name that resolves to a Spring bean. Beans in the application context are read-only from process expressions; writing to them is blocked to protect shared application state.

Solutions

  1. Rename the process variable so it does not collide with a bean name.
  2. Assign to a process variable via runtimeService.setVariable instead of EL assignment.
  3. If the value must be changed, delegate to a service task/JavaDelegate rather than assigning to the bean.
  4. Catch ActivitiException if the assignment is user-supplied input and reject it with a clear message.

Example fix

// before
<flowable:expression>${orderService = newValue}</flowable:expression> // orderService is a bean
// after
<flowable:expression>${execution.setVariable('order', newValue)}</flowable:expression>
Defensive patterns

Strategy: validation

Validate before calling

String candidate = "order"; // name used in EL assignment
if (applicationContext.containsBean(candidate)) throw new IllegalArgumentException("'" + candidate + "' collides with a Spring bean name; rename the variable");

Try / catch

try { delegateExpressionInvocation(); } catch (ActivitiException e) { log.error("Attempted to overwrite a Spring bean from EL: {}", e.getMessage()); }

Prevention

When it happens

Trigger: An expression like ${myBean = something} or a task/form field assignment targeting a name that matches a Spring bean id in the process expressions.

Common situations: Typos in process variables that coincide with bean names; intentionally trying to mutate a bean from a script/expression; copying variable names from bean names.

Understand the failure class

Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable5-spring/src/main/java/org/activiti/spring/ApplicationContextElResolver.java:58

                context.setPropertyResolved(true);
                return applicationContext.getBean(key);
            }
        }

        return null;
    }

    @Override
    public boolean isReadOnly(ELContext context, Object base, Object property) {
        return true;
    }

    @Override
    public void setValue(ELContext context, Object base, Object property, Object value) {
        if (base == null) {
            String key = (String) property;
            if (applicationContext.containsBean(key)) {
                throw new ActivitiException("Cannot set value of '" + property + "', it resolves to a bean defined in the Spring application-context.");
            }
        }
    }

    @Override
    public Class<?> getCommonPropertyType(ELContext context, Object arg) {
        return Object.class;
    }

    @Override
    public Class<?> getType(ELContext context, Object arg1, Object arg2) {
        return Object.class;
    }
}

View on GitHub (pinned to d6d39ce1c6)