{"record":{"id":"976e3e8c0e0f5f42","repo":"theonedev/onedev","slug":"unable-to-find-resource-method-resource-s-meth","errorCode":null,"errorMessage":"Unable to find resource method (resource: %s, method: %s)","messagePattern":"Unable to find resource method \\(resource: (.+?), method: (.+?)\\)","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/web/page/help/MethodDetailPage.java","lineNumber":71,"sourceCode":"\tprivate static final String PARAM_RESOURCE = \"resource\";\n\t\n\tprivate static final String PARAM_METHOD = \"method\";\n\t\n\tprivate final Class<?> resourceClass;\n\t\n\tprivate final String methodName;\n\t\n\tprivate final IModel<Method> methodModel = new LoadableDetachableModel<Method>() {\n\n\t\t@Override\n\t\tprotected Method load() {\n\t\t\tfor (Method method: resourceClass.getMethods()) {\n\t\t\t\tif (method.getName().equals(methodName))\n\t\t\t\t\treturn method;\n\t\t\t}\n\t\t\tString errorMessage = String.format(\"Unable to find resource method (resource: %s, method: %s)\", \n\t\t\t\t\tresourceClass.getName(), methodName);\n\t\t\tthrow new NotFoundException(errorMessage);\n\t\t}\n\t\t\n\t};\n\t\n\tpublic MethodDetailPage(PageParameters params) {\n\t\tsuper(params);\n\n\t\tvar className = params.get(PARAM_RESOURCE).toString();\n\t\ttry {\n\t\t\tresourceClass = Class.forName(className);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tthrow new NotFoundException(\"Resource class not found: \" + className);\n\t\t}\n\t\t\n\t\tmethodName = params.get(PARAM_METHOD).toString();\n\t}\n\n\t@Override","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/web/page/help/MethodDetailPage.java#L53-L89","documentation":"MethodDetailPage (REST API help pages) resolves a JAX-RS resource method by name within the resource class via a loadable model. If no public method with the given name exists, it throws NotFoundException with the class and method names.","triggerScenarios":"Opening a help page /~help/api/<resource>/<method> where <method> is not a method of the resolved resource class.","commonSituations":"Outdated links after an API method was renamed/removed in a OneDev upgrade; typo in the method name in a hand-written URL.","solutions":["Browse the API help index and use the current method name.","Update bookmarks after OneDev upgrades.","Confirm the method exists on the named resource class."],"exampleFix":"// before: /~help/api/UserResource/getOldName\n// after: /~help/api/UserResource/getFullName (renamed method)","handlingStrategy":"try-catch","validationCode":"// check the method exists on the resource class before deep-linking\nvar m = Arrays.stream(resourceClass.getMethods())\n    .anyMatch(x -> x.getName().equals(methodName));","typeGuard":null,"tryCatchPattern":"try {\n    openMethodHelp(resource, method);\n} catch (NotFoundException e) {\n    openApiHelpIndex();\n}","preventionTips":["Regenerate API links after upgrades.","Use the API help index for navigation.","Verify method names against current source/annotations."],"tags":["onedev","rest-api","help","not-found"],"backgroundTag":"record-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}