{"record":{"id":"955a25bad55bffec","repo":"mockito/mockito","slug":"failed-to-access-default-method-or-invoked-method","errorCode":null,"errorMessage":"Failed to access default method or invoked method with illegal arguments\n\nMethod \" + serializableMethod.getJavaMethod() + \" could not be delegated, this is not supposed to happen\n\" + Platform.describe()","messagePattern":"Failed to access default method or invoked method with illegal arguments\n\nMethod \" \\+ serializableMethod\\.getJavaMethod\\(\\) \\+ \" could not be delegated, this is not supposed to happen\n\" \\+ Platform\\.describe\\(\\)","errorType":"exception","errorClass":"MockitoException","httpStatus":null,"severity":"error","filePath":"mockito-core/src/main/java/org/mockito/internal/creation/proxy/InvokeDefaultProxy.java","lineNumber":60,"sourceCode":"        private InvokeDefaultRealMethod(Object proxy, Method method, Object[] args) {\n            this.proxy = proxy;\n            this.serializableMethod = new SerializableMethod(method);\n            this.args = args;\n        }\n\n        @Override\n        public boolean isInvokable() {\n            return true;\n        }\n\n        @Override\n        public Object invoke() throws Throwable {\n            try {\n                return invokeDefault.invoke(null, proxy, serializableMethod.getJavaMethod(), args);\n            } catch (InvocationTargetException e) {\n                throw e.getTargetException();\n            } catch (IllegalAccessException | IllegalArgumentException e) {\n                throw new MockitoException(\n                        join(\n                                \"Failed to access default method or invoked method with illegal arguments\",\n                                \"\",\n                                \"Method \"\n                                        + serializableMethod.getJavaMethod()\n                                        + \" could not be delegated, this is not supposed to happen\",\n                                Platform.describe()),\n                        e);\n            }\n        }\n    }\n}\n","sourceCodeStart":42,"sourceCodeEnd":73,"githubUrl":"https://github.com/mockito/mockito/blob/5a676bcd9ef9a10db46e1dc34e190eb46faa2687/mockito-core/src/main/java/org/mockito/internal/creation/proxy/InvokeDefaultProxy.java#L42-L73","documentation":"Error \"Failed to access default method or invoked method with illegal arguments\n\nMethod \" + serializableMethod.getJavaMethod() + \" could not be delegated, this is not supposed to happen\n\" + Platform.describe()\" thrown in mockito/mockito.","triggerScenarios":"Thrown at mockito-core/src/main/java/org/mockito/internal/creation/proxy/InvokeDefaultProxy.java:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the reflected Method passed to the proxy matches an interface default method of that proxy","Pass argument arrays whose types match the method's parameter types","Upgrade mockito-core if on an older version, since proxy default-method invocation handling has been improved","If the JVM offers non-standard MethodHandles.Lookup behavior, run tests on a standard JDK or update Mockito/byte-buddy"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5a676bcd9ef9a10db46e1dc34e190eb46faa2687","analyzedAt":"2026-09-05T19:32:58.607Z","contentChangedAt":"2026-09-05T19:32:58.607Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}