{"record":{"id":"4e245470ba2fe01f","repo":"flowable/flowable-engine","slug":"delegateinstance-getclass-getname-does-4e2454","errorCode":null,"errorMessage":"\" + delegateInstance.getClass().getName() + \" doesn't implement \" + HttpResponseHandler.class","messagePattern":"\" \\+ delegateInstance\\.getClass\\(\\)\\.getName\\(\\) \\+ \" doesn't implement \" \\+ HttpResponseHandler\\.class","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/http/handler/ClassDelegateHttpHandler.java","lineNumber":76,"sourceCode":"        HttpResponseHandler httpResponseHandler = getHttpResponseHandlerInstance();\n        CommandContextUtil.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new HttpResponseHandlerInvocation(httpResponseHandler, execution, httpResponse));\n    }\n\n    protected HttpRequestHandler getHttpRequestHandlerInstance() {\n        Object delegateInstance = instantiateDelegate(className, fieldDeclarations);\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 = instantiateDelegate(className, fieldDeclarations);\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":58,"sourceCodeEnd":81,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/http/handler/ClassDelegateHttpHandler.java#L58-L81","documentation":"ClassDelegateHttpHandler.getHttpResponseHandlerInstance throws this FlowableIllegalArgumentException when the configured HTTP response handler class is instantiated but does not implement the HttpResponseHandler interface. The engine checks the type contract at instantiation time.","triggerScenarios":"HTTP activity configuration points HttpResponseHandler handling at a class that doesn't implement org.flowable.http.HttpResponseHandler (e.g. a request handler class or an unrelated delegate); the handler instance is lazily created when a response handler is first needed.","commonSituations":"Request/response handler classes swapped in configuration; class implements HttpRequestHandler only; stale config after interface rename across Flowable versions; annotation/bean wiring passing the wrong class reference to ClassDelegateHttpHandler's constructor.","solutions":["Make the configured class implement HttpResponseHandler (add httpResponse(...)) or point the config at the correct class.","Check for swapped arguments: ensure the response-handler className slot doesn't reference the request handler.","Verify the import — use the HttpResponseHandler interface from the same Flowable module version as the engine.","Add a fast-failing test: instantiate the handler class and assert it instanceof HttpResponseHandler."],"exampleFix":"// before\nhttpHandlerConfig.setResponseHandlerClassName(MyRequestHandler.class.getName());\n\n// after\nhttpHandlerConfig.setResponseHandlerClassName(MyResponseHandler.class.getName());","handlingStrategy":"validation","validationCode":"Class<?> c = Class.forName(configuredResponseHandlerClass);\nif (!HttpResponseHandler.class.isAssignableFrom(c)) {\n    throw new IllegalStateException(configuredResponseHandlerClass + \" must implement HttpResponseHandler\");\n}","typeGuard":"static boolean isResponseHandler(String className) throws ClassNotFoundException {\n    return HttpResponseHandler.class.isAssignableFrom(Class.forName(className));\n}","tryCatchPattern":"try {\n    handler.getHttpResponseHandlerInstance();\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"doesn't implement\")) {\n        // fall back to default response handling\n    }\n}","preventionTips":["Verify response-handler config points at an HttpResponseHandler implementation.","Guard against swapped request/response handler class references in config.","Add a fast-failing instantiation test for both handler types."],"tags":["flowable","http-task","delegate","type-mismatch","class-config"],"backgroundTag":"incompatible-source-type","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"}