flowable/flowable-engine · error · FlowableIllegalArgumentException

Delegate expression ${expression} did not resolve to an impl

Error message

Delegate expression ${expression} did not resolve to an implementation of ${HttpRequestHandler.class}

What it means

A delegate expression used as an HTTP request handler resolved, but the resulting object does not implement HttpRequestHandler. Flowable resolves the expression against the variable scope and enforces the handler interface at call time.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/http/handler/DelegateExpressionHttpHandler.java:52

public class DelegateExpressionHttpHandler implements HttpRequestHandler, HttpResponseHandler {

    private static final long serialVersionUID = 1L;

    protected Expression expression;
    protected final List<FieldExtension> fieldExtensions;

    public DelegateExpressionHttpHandler(Expression expression, List<FieldExtension> fieldDeclarations) {
        this.expression = expression;
        this.fieldExtensions = fieldDeclarations;
    }

    @Override
    public void handleHttpRequest(VariableContainer execution, HttpRequest httpRequest, FlowableHttpClient client) {
        Object delegate = DelegateExpressionUtil.resolveDelegateExpression(expression, execution, fieldExtensions);
        if (delegate instanceof HttpRequestHandler) {
            ((HttpRequestHandler) delegate).handleHttpRequest(execution, httpRequest, client);
        } else {
            throw new FlowableIllegalArgumentException("Delegate expression " + expression + " did not resolve to an implementation of " + HttpRequestHandler.class);
        }
    }

    @Override
    public void handleHttpResponse(VariableContainer execution, HttpResponse httpResponse) {
        Object delegate = resolveDelegateExpression(expression, execution, fieldExtensions);
        if (delegate instanceof HttpResponseHandler) {
            ((HttpResponseHandler) delegate).handleHttpResponse(execution, httpResponse);
        } else {
            throw new FlowableIllegalArgumentException("Delegate expression " + expression + " did not resolve to an implementation of " + HttpResponseHandler.class);
        }
    }

    /**
     * returns the expression text for this execution listener. Comes in handy if you want to check which listeners you already have.
     */
    public String getExpressionText() {
        return expression.getExpressionText();

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Point the delegate expression to an object implementing org.flowable.http.HttpRequestHandler
  2. Fix the bean definition/expression name if it refers to the wrong bean
  3. Add the handleHttpRequest method by implementing HttpRequestHandler in the target class

Example fix

// before
<bean id="myHandler" class="com.acme.NotAHandler" />
<flowable:handler delegateExpression="${myHandler}" />
// after
<bean id="myHandler" class="com.acme.MyRequestHandler" /> <!-- implements HttpRequestHandler -->
<flowable:handler delegateExpression="${myHandler}" />
Defensive patterns

Strategy: try-catch

Validate before calling

Object d = context.getBean(beanName);
if (!(d instanceof HttpRequestHandler)) throw new Error(beanName + ' is not an HttpRequestHandler');

Type guard

function isHttpRequestHandler(o) { return o != null && typeof o.handleHttpRequest === 'function'; }

Try / catch

try { handleRequest(); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().contains('did not resolve')) fixBeanReference(); else throw e; }

Prevention

When it happens

Trigger: handleHttpRequest resolves the expression (e.g. ${myHandlerBean}) to a bean/object of the wrong type for an http service task's request handling.

Common situations: Expression points to a Spring bean of the wrong type; bean renamed/replaced with an incompatible implementation; expression reused from response-handler config.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


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