{"record":{"id":"c52110a43307dbd0","repo":"flowable/flowable-engine","slug":"delegate-expression-expression-did-not-resolve-c52110","errorCode":null,"errorMessage":"Delegate expression ${expression} did not resolve to an implementation of org.flowable.engine.delegate.event.FlowableEventListener","messagePattern":"Delegate expression (.+?) did not resolve to an implementation of org\\.flowable\\.engine\\.delegate\\.event\\.FlowableEventListener","errorType":"exception","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/helper/DelegateExpressionActivitiEventListener.java","lineNumber":56,"sourceCode":"\n    @Override\n    public void onEvent(FlowableEvent event) {\n        if (isValidEvent(event)) {\n            Object delegate = DelegateExpressionUtil.resolveDelegateExpression(expression, new NoExecutionVariableScope());\n            if (delegate instanceof FlowableEventListener) {\n                // Cache result of isFailOnException() from delegate-instance until next\n                // event is received. This prevents us from having to resolve the expression twice when\n                // an error occurs.\n                failOnException = ((FlowableEventListener) delegate).isFailOnException();\n\n                // Call the delegate\n                ((FlowableEventListener) delegate).onEvent(event);\n            } else {\n\n                // Force failing, since the exception we're about to throw cannot be ignored, because it\n                // did not originate from the listener itself\n                failOnException = true;\n                throw new ActivitiIllegalArgumentException(\"Delegate expression \" + expression\n                        + \" did not resolve to an implementation of \" + FlowableEventListener.class.getName());\n            }\n        }\n    }\n\n    @Override\n    public boolean isFailOnException() {\n        return failOnException;\n    }\n\n}\n","sourceCodeStart":38,"sourceCodeEnd":68,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/helper/DelegateExpressionActivitiEventListener.java#L38-L68","documentation":"DelegateExpressionActivitiEventListener resolves its delegate from an expression (e.g. a Spring bean). If the resolved object is null or not an instance of FlowableEventListener, it throws ActivitiIllegalArgumentException and forces failure of event dispatch.","triggerScenarios":"A listener registered with a delegateExpression whose expression resolves to a bean that is not a FlowableEventListener (or does not resolve at all to the right type).","commonSituations":"Spring bean of the wrong type wired into the process engine config; bean defined but wrong interface implemented; expression typo resolving to an unrelated bean; bean scope/proxy returning an unexpected wrapper.","solutions":["Ensure the referenced bean implements org.flowable.engine.delegate.event.FlowableEventListener","Verify the expression (e.g. ${myListener}) names the correct bean in the application context","Check the bean is a plain listener implementation, not a proxy/wrapper hiding the interface","Fix the delegateExpression value in the listener registration config or BPMN XML"],"exampleFix":"// before\n<flowable:eventListener events=\"JOB_EXECUTION_SUCCESS\" delegateExpression=\"${myPojo}\"/>\n// after\n<flowable:eventListener events=\"JOB_EXECUTION_SUCCESS\" delegateExpression=\"${myEventListener}\"/> <!-- implements FlowableEventListener -->","handlingStrategy":"validation","validationCode":"Object bean = applicationContext.getBean(\"myEventListener\");\nif (!(bean instanceof FlowableEventListener)) throw new IllegalArgumentException(\"bean must implement FlowableEventListener\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify bean types in a Spring context smoke test before deploying","Keep listener expressions pointing at dedicated listener beans","Avoid proxies around listeners unless they expose FlowableEventListener"],"tags":["java","events","listener","expression"],"backgroundTag":"invalid-argument-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}