{"record":{"id":"65737c75208e20d6","repo":"flowable/flowable-engine","slug":"delegateinstance-getclass-getname-doesn-t-i-65737c","errorCode":null,"errorMessage":"${delegateInstance.getClass().getName()} doesn't implement ${HttpResponseHandler.class}","messagePattern":"(.+?) doesn't implement (.+?)","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/ClassDelegateHttpHandler.java","lineNumber":73,"sourceCode":"        HttpResponseHandler httpResponseHandler = getHttpResponseHandlerInstance();\n        httpResponseHandler.handleHttpResponse(execution, httpResponse);\n    }\n\n    protected HttpRequestHandler getHttpRequestHandlerInstance() {\n        Object delegateInstance = instantiate(className);\n        if (delegateInstance instanceof HttpRequestHandler) {\n            return (HttpRequestHandler) delegateInstance;\n        } else {\n            throw new FlowableIllegalArgumentException(delegateInstance.getClass().getName() + \" doesn't implement \" + HttpRequestHandler.class);\n        }\n    }\n\n    protected HttpResponseHandler getHttpResponseHandlerInstance() {\n        Object delegateInstance = instantiate(className);\n        if (delegateInstance instanceof HttpResponseHandler) {\n            return (HttpResponseHandler) delegateInstance;\n        } else {\n            throw new FlowableIllegalArgumentException(delegateInstance.getClass().getName() + \" doesn't implement \" + HttpResponseHandler.class);\n        }\n    }\n\n}\n","sourceCodeStart":55,"sourceCodeEnd":78,"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/ClassDelegateHttpHandler.java#L55-L78","documentation":"The class-delegate HTTP handler configuration points to a class that does not implement org.flowable.http.HttpResponseHandler. The instantiated object fails the instanceof check in getHttpResponseHandlerInstance.","triggerScenarios":"An http activity's response handling resolves ClassDelegateHttpHandler whose className instantiates to a non-HttpResponseHandler object.","commonSituations":"Same class configured for both request and response handling but only implementing HttpRequestHandler; copy-paste of handler config with wrong class.","solutions":["Make the configured class implement org.flowable.http.HttpResponseHandler (handleHttpResponse method)","Or configure a class that actually implements HttpResponseHandler","If it is a request handler, move it to the http request handler configuration instead"],"exampleFix":"// before\npublic class MyHandler implements HttpRequestHandler { ... }\n// after\npublic class MyHandler implements HttpResponseHandler {\n    @Override\n    public void handleHttpResponse(VariableContainer execution, HttpResponse response) { ... }\n}","handlingStrategy":"validation","validationCode":"Class<?> c = Class.forName(className);\nif (!HttpResponseHandler.class.isAssignableFrom(c)) throw new Error(className + ' must implement HttpResponseHandler');","typeGuard":"function isResponseHandler(o) { return o != null && o.handleHttpResponse != null; }","tryCatchPattern":"try { getHandler(); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().contains('doesn't implement')) reconfigureDelegate(); else throw e; }","preventionTips":["Verify handler interfaces when copy-pasting http task config","Unit-test response handlers against a mock HttpResponse","Use distinct bean/class names for request vs response handlers"],"tags":["cmmn","http","delegate","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"}