{"record":{"id":"236f20f1a58dda2d","repo":"theonedev/onedev","slug":"resource-class-not-found-classname","errorCode":null,"errorMessage":"Resource class not found: ${className}","messagePattern":"Resource class not found: (.+?)","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/web/page/help/MethodDetailPage.java","lineNumber":83,"sourceCode":"\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\n\tprotected void onDetach() {\n\t\tmethodModel.detach();\n\t\tsuper.onDetach();\n\t}\n\t\n\tprivate Method getResourceMethod() {\n\t\treturn methodModel.getObject();\n\t}\n\n\t@Nullable\n\tprivate Parameter getRequestBodyParam() {\n\t\tfor (Parameter param: getResourceMethod().getParameters()) {","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/web/page/help/MethodDetailPage.java#L65-L101","documentation":"MethodDetailPage loads the REST resource class named in page parameters with Class.forName. If the class cannot be found on the classpath, it throws NotFoundException('Resource class not found: ...').","triggerScenarios":"Visiting /~help/api/<className>/<method> where <className> is not a loadable class in the current build.","commonSituations":"Links saved before an upgrade that removed/moved the resource class; plugin providing the REST resource is no longer installed; typo in fully-qualified class name.","solutions":["Start from the API help index instead of saved deep links.","Reinstall the plugin that provided the REST resource.","Check the exact fully-qualified class name in the current OneDev version."],"exampleFix":"// before: /~help/api/io.onedev.server.rest.OldResource/get\n// after: /~help/api/io.onedev.server.rest.UserResource/get","handlingStrategy":"try-catch","validationCode":"boolean ok;\ntry { Class.forName(className); ok = true; } catch (ClassNotFoundException e) { ok = false; }","typeGuard":null,"tryCatchPattern":"try {\n    openMethodHelp(className, method);\n} catch (NotFoundException e) {\n    openApiHelpIndex();\n}","preventionTips":["Use fully-qualified class names from the current build.","Reinstall plugins that provide REST resources.","Regenerate deep links after upgrades or plugin changes."],"tags":["onedev","rest-api","class-not-found"],"backgroundTag":"class-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"}