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 ${HttpResponseHandler.class}

What it means

A delegate expression used as an HTTP response handler resolved, but the resulting object does not implement HttpResponseHandler. Enforced at response-handling time in DelegateExpressionHttpHandler.handleHttpResponse.

Source

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

    }

    @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();
    }

    public static Object resolveDelegateExpression(Expression expression,
                                                   VariableContainer variableScope, List<FieldExtension> fieldExtensions) {

        // Note: we can't cache the result of the expression, because the
        // execution can change: eg. delegateExpression='${mySpringBeanFactory.randomSpringBean()}'
        Object delegate = expression.getValue(variableScope);

        if (fieldExtensions != null && fieldExtensions.size() > 0) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Point the delegate expression to an object implementing org.flowable.http.HttpResponseHandler
  2. Implement HttpResponseHandler in the target class
  3. Correct the expression if it references the wrong bean

Example fix

// before
<flowable:response-handler delegateExpression="${requestHandler}" />
// after
<flowable:response-handler delegateExpression="${responseHandler}" /> <!-- implements HttpResponseHandler -->
Defensive patterns

Strategy: try-catch

Validate before calling

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

Type guard

function isHttpResponseHandler(o) { return o != null && typeof o.handleHttpResponse === 'function'; }

Try / catch

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

Prevention

When it happens

Trigger: handleHttpResponse resolves the expression to a non-HttpResponseHandler object when an HTTP response arrives in a CMMN http service task.

Common situations: Expression pointing to a request handler bean (wrong interface); Spring bean returning a different type than expected; config copied from request handler block.

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/835c0131a418aabb. Report an issue: GitHub.