{"record":{"id":"72261ba0a6e90537","repo":"OpenFeign/feign","slug":"default-method-handler-invoked-before-proxy-has-be","errorCode":null,"errorMessage":"Default method handler invoked before proxy has been bound.","messagePattern":"Default method handler invoked before proxy has been bound\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/feign/DefaultMethodHandler.java","lineNumber":143,"sourceCode":"   * was called on the proxy object. Must be called once and only once for a given instance of\n   * DefaultMethodHandler\n   */\n  public void bindTo(Object proxy) {\n    if (handle != null) {\n      throw new IllegalStateException(\n          \"Attempted to rebind a default method handler that was already bound\");\n    }\n    handle = unboundHandle.bindTo(proxy);\n  }\n\n  /**\n   * Invoke this method. DefaultMethodHandler#bindTo must be called before the first time invoke is\n   * called.\n   */\n  @Override\n  public Object invoke(Object[] argv) throws Throwable {\n    if (handle == null) {\n      throw new IllegalStateException(\n          \"Default method handler invoked before proxy has been bound.\");\n    }\n    return handle.invokeWithArguments(argv);\n  }\n}\n","sourceCodeStart":125,"sourceCodeEnd":149,"githubUrl":"https://github.com/OpenFeign/feign/blob/e2a1e27560a1e68840c34f031afca88b36096e30/core/src/main/java/feign/DefaultMethodHandler.java#L125-L149","documentation":"Thrown by DefaultMethodHandler.bindTo when attempting to bind a handler that already has a non-null handle, i.e., bindTo was called a second time on the same DefaultMethodHandler instance. Per the contract in the Javadoc, a handler must be bound exactly once per instance; this is an internal guard against double binding of a Java default method invocation handle, typically caused by reusing a handler across proxy creations.","triggerScenarios":"Thrown at core/src/main/java/feign/DefaultMethodHandler.java:143 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not reuse DefaultMethodHandler instances across multiple Feign.newInstance calls; create fresh handlers for each proxy","If binding manually, ensure bindTo is invoked exactly once per handler instance","Report as a Feign bug if it occurs with the public Feign.builder() API, since binding is normally managed internally"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e2a1e27560a1e68840c34f031afca88b36096e30","analyzedAt":"2026-09-10T12:37:37.238Z","contentChangedAt":"2026-09-10T12:37:37.238Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}