{"record":{"id":"6338564a60e5e5c9","repo":"mybatis/mybatis-3","slug":"cannot-resolve-the-provider-method-because-metho-633856","errorCode":null,"errorMessage":"Cannot resolve the provider method because '{methodName}' is found multiple in SqlProvider '{className}'.","messagePattern":"Cannot resolve the provider method because '(.+?)' is found multiple in SqlProvider '(.+?)'\\.","errorType":"exception","errorClass":"BuilderException","httpStatus":null,"severity":"error","filePath":"src/main/java/org/apache/ibatis/builder/annotation/ProviderMethodResolver.java","lineNumber":71,"sourceCode":"   *           Throws when cannot resolve a target method\n   */\n  default Method resolveMethod(ProviderContext context) {\n    List<Method> sameNameMethods = Arrays.stream(getClass().getMethods())\n        .filter(m -> m.getName().equals(context.getMapperMethod().getName())).collect(Collectors.toList());\n    if (sameNameMethods.isEmpty()) {\n      throw new BuilderException(\"Cannot resolve the provider method because '\" + context.getMapperMethod().getName()\n          + \"' not found in SqlProvider '\" + getClass().getName() + \"'.\");\n    }\n    List<Method> targetMethods = sameNameMethods.stream()\n        .filter(m -> CharSequence.class.isAssignableFrom(m.getReturnType())).collect(Collectors.toList());\n    if (targetMethods.size() == 1) {\n      return targetMethods.get(0);\n    }\n    if (targetMethods.isEmpty()) {\n      throw new BuilderException(\"Cannot resolve the provider method because '\" + context.getMapperMethod().getName()\n          + \"' does not return the CharSequence or its subclass in SqlProvider '\" + getClass().getName() + \"'.\");\n    }\n    throw new BuilderException(\"Cannot resolve the provider method because '\" + context.getMapperMethod().getName()\n        + \"' is found multiple in SqlProvider '\" + getClass().getName() + \"'.\");\n  }\n\n}\n","sourceCodeStart":53,"sourceCodeEnd":76,"githubUrl":"https://github.com/mybatis/mybatis-3/blob/008069adb1b089579b5dcba87ee591908b263274/src/main/java/org/apache/ibatis/builder/annotation/ProviderMethodResolver.java#L53-L76","documentation":"Error \"Cannot resolve the provider method because '{methodName}' is found multiple in SqlProvider '{className}'.\" thrown in mybatis/mybatis-3.","triggerScenarios":"Thrown at src/main/java/org/apache/ibatis/builder/annotation/ProviderMethodResolver.java:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or rename the duplicate provider methods so only one method with that name exists in the SqlProvider class.","SqlProvider methods cannot be overloaded; merge the overloads into a single method that handles all parameter cases."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"008069adb1b089579b5dcba87ee591908b263274","analyzedAt":"2026-08-14T13:07:10.264Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}