theonedev/onedev · error · NotFoundException

Resource class not found: ${className}

Error message

Resource class not found: ${className}

What it means

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: ...').

Source

Thrown at server-core/src/main/java/io/onedev/server/web/page/help/MethodDetailPage.java:83

			for (Method method: resourceClass.getMethods()) {
				if (method.getName().equals(methodName))
					return method;
			}
			String errorMessage = String.format("Unable to find resource method (resource: %s, method: %s)", 
					resourceClass.getName(), methodName);
			throw new NotFoundException(errorMessage);
		}
		
	};
	
	public MethodDetailPage(PageParameters params) {
		super(params);

		var className = params.get(PARAM_RESOURCE).toString();
		try {
			resourceClass = Class.forName(className);
		} catch (ClassNotFoundException e) {
			throw new NotFoundException("Resource class not found: " + className);
		}
		
		methodName = params.get(PARAM_METHOD).toString();
	}

	@Override
	protected void onDetach() {
		methodModel.detach();
		super.onDetach();
	}
	
	private Method getResourceMethod() {
		return methodModel.getObject();
	}

	@Nullable
	private Parameter getRequestBodyParam() {
		for (Parameter param: getResourceMethod().getParameters()) {

View on GitHub (pinned to d44925c47c)

Solutions

  1. Start from the API help index instead of saved deep links.
  2. Reinstall the plugin that provided the REST resource.
  3. Check the exact fully-qualified class name in the current OneDev version.

Example fix

// before: /~help/api/io.onedev.server.rest.OldResource/get
// after: /~help/api/io.onedev.server.rest.UserResource/get
Defensive patterns

Strategy: try-catch

Validate before calling

boolean ok;
try { Class.forName(className); ok = true; } catch (ClassNotFoundException e) { ok = false; }

Try / catch

try {
    openMethodHelp(className, method);
} catch (NotFoundException e) {
    openApiHelpIndex();
}

Prevention

When it happens

Trigger: Visiting /~help/api/<className>/<method> where <className> is not a loadable class in the current build.

Common situations: 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.

Related errors


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/236f20f1a58dda2d. Report an issue: GitHub.