{"record":{"id":"4791eae3fe249e46","repo":"flowable/flowable-engine","slug":"delegate-expression-expression-did-not-resolve","errorCode":null,"errorMessage":"Delegate expression ${expression} did not resolve to an implementation of ${HttpRequestHandler.class}","messagePattern":"Delegate expression (.+?) did not resolve to an implementation of (.+?)","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/http/handler/DelegateExpressionHttpHandler.java","lineNumber":52,"sourceCode":"public class DelegateExpressionHttpHandler implements HttpRequestHandler, HttpResponseHandler {\n\n    private static final long serialVersionUID = 1L;\n\n    protected Expression expression;\n    protected final List<FieldExtension> fieldExtensions;\n\n    public DelegateExpressionHttpHandler(Expression expression, List<FieldExtension> fieldDeclarations) {\n        this.expression = expression;\n        this.fieldExtensions = fieldDeclarations;\n    }\n\n    @Override\n    public void handleHttpRequest(VariableContainer execution, HttpRequest httpRequest, FlowableHttpClient client) {\n        Object delegate = DelegateExpressionUtil.resolveDelegateExpression(expression, execution, fieldExtensions);\n        if (delegate instanceof HttpRequestHandler) {\n            ((HttpRequestHandler) delegate).handleHttpRequest(execution, httpRequest, client);\n        } else {\n            throw new FlowableIllegalArgumentException(\"Delegate expression \" + expression + \" did not resolve to an implementation of \" + HttpRequestHandler.class);\n        }\n    }\n\n    @Override\n    public void handleHttpResponse(VariableContainer execution, HttpResponse httpResponse) {\n        Object delegate = resolveDelegateExpression(expression, execution, fieldExtensions);\n        if (delegate instanceof HttpResponseHandler) {\n            ((HttpResponseHandler) delegate).handleHttpResponse(execution, httpResponse);\n        } else {\n            throw new FlowableIllegalArgumentException(\"Delegate expression \" + expression + \" did not resolve to an implementation of \" + HttpResponseHandler.class);\n        }\n    }\n\n    /**\n     * returns the expression text for this execution listener. Comes in handy if you want to check which listeners you already have.\n     */\n    public String getExpressionText() {\n        return expression.getExpressionText();","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/http/handler/DelegateExpressionHttpHandler.java#L34-L70","documentation":"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.","triggerScenarios":"handleHttpRequest resolves the expression (e.g. ${myHandlerBean}) to a bean/object of the wrong type for an http service task's request handling.","commonSituations":"Expression points to a Spring bean of the wrong type; bean renamed/replaced with an incompatible implementation; expression reused from response-handler config.","solutions":["Point the delegate expression to an object implementing org.flowable.http.HttpRequestHandler","Fix the bean definition/expression name if it refers to the wrong bean","Add the handleHttpRequest method by implementing HttpRequestHandler in the target class"],"exampleFix":"// before\n<bean id=\"myHandler\" class=\"com.acme.NotAHandler\" />\n<flowable:handler delegateExpression=\"${myHandler}\" />\n// after\n<bean id=\"myHandler\" class=\"com.acme.MyRequestHandler\" /> <!-- implements HttpRequestHandler -->\n<flowable:handler delegateExpression=\"${myHandler}\" />","handlingStrategy":"try-catch","validationCode":"Object d = context.getBean(beanName);\nif (!(d instanceof HttpRequestHandler)) throw new Error(beanName + ' is not an HttpRequestHandler');","typeGuard":"function isHttpRequestHandler(o) { return o != null && typeof o.handleHttpRequest === 'function'; }","tryCatchPattern":"try { handleRequest(); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().contains('did not resolve')) fixBeanReference(); else throw e; }","preventionTips":["Check Spring bean types wired into delegate expressions","Prefer class delegates with compile-time interface checks when possible","Add an application-startup assertion resolving every delegate expression"],"tags":["cmmn","http","delegate-expression","type-mismatch"],"backgroundTag":"type-mismatch","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}