{"record":{"id":"6a11fc1acc43c165","repo":"flowable/flowable-engine","slug":"class-s-does-not-implement-s","errorCode":null,"errorMessage":"Class %s does not implement %s","messagePattern":"Class (.+?) does not implement (.+?)","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/helper/DelegateActivitiEventListener.java","lineNumber":63,"sourceCode":"    }\n\n    @Override\n    public boolean isFailOnException() {\n        if (delegateInstance != null) {\n            return delegateInstance.isFailOnException();\n        }\n        return failOnException;\n    }\n\n    protected FlowableEventListener getDelegateInstance() {\n        if (delegateInstance == null) {\n            Object instance = ReflectUtil.instantiate(className);\n            if (instance instanceof FlowableEventListener) {\n                delegateInstance = (FlowableEventListener) instance;\n            } else {\n                // Force failing of the listener invocation, since the delegate cannot be created\n                failOnException = true;\n                throw new ActivitiIllegalArgumentException(\"Class \" + className\n                        + \" does not implement \" + FlowableEventListener.class.getName());\n            }\n        }\n        return delegateInstance;\n    }\n}\n","sourceCodeStart":45,"sourceCodeEnd":70,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/helper/DelegateActivitiEventListener.java#L45-L70","documentation":"DelegateActivitiEventListener lazily instantiates its listener delegate from a class name via reflection. If the instantiated object does not implement FlowableEventListener, it throws ActivitiIllegalArgumentException and forces the dispatch to fail rather than silently skip the event.","triggerScenarios":"An event listener registered (e.g. via engine config addEventlistener or process XML <flowable:eventListener>) with a class attribute whose class exists and instantiates, but does not implement org.flowable.engine.delegate.event.FlowableEventListener.","commonSituations":"Registering a plain POJO or wrong listener interface implementation by mistake; migrating from another listener interface (e.g. ActivitiEventListener in old versions vs FlowableEventListener); class name pointing to an unrelated class after refactor.","solutions":["Make the configured class implement org.flowable.engine.delegate.event.FlowableEventListener (with onEvent and isFailOnException)","Fix the class name in the listener registration to point at the actual listener class","Check for stale copies of the class still implementing an old/other interface","Redeploy/restart after correcting the configuration"],"exampleFix":"// before\npublic class MyListener { /* no interface */ }\n// after\npublic class MyListener implements FlowableEventListener {\n    public void onEvent(FlowableEvent event) { /* ... */ }\n    public boolean isFailOnException() { return true; }\n}","handlingStrategy":"validation","validationCode":"if (!FlowableEventListener.class.isAssignableFrom(listenerClass)) throw new IllegalArgumentException(listenerClass + \" must implement FlowableEventListener\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always implement FlowableEventListener for classes used as event listeners","Verify listener class names at engine configuration time","Write a config test that instantiates all registered listeners"],"tags":["java","events","listener","bpmn"],"backgroundTag":"class-not-found","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"}