quarkusio/quarkus · error · RuntimeException
Could not find provider class: ${name}
Error message
Could not find provider class: ${name} What it means
providerClassForName() loads each REST client provider class by name from the thread context ClassLoader and wraps ClassNotFoundException in a RuntimeException when the class is absent. Providers listed in @RegisterProvider, quarkus.rest-client.<key>.providers, or MP RestClient config must be on the runtime classpath.
Source
Thrown at extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/RestClientBase.java:266
}
if (clientProviders != null) {
for (Class<?> annotationProvider : clientProviders) {
builder.register(annotationProvider);
}
}
}
private void registerProviders(RestClientBuilder builder, String providersAsString) {
for (String s : providersAsString.split(",")) {
builder.register(providerClassForName(s.trim()));
}
}
private Class<?> providerClassForName(String name) {
try {
return Class.forName(name, true, Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundException e) {
throw new RuntimeException("Could not find provider class: " + name);
}
}
protected void configureTimeouts(RestClientBuilder builder) {
Long connectTimeout = restClientConfig.connectTimeout().orElse(this.configRoot.connectTimeout());
if (connectTimeout != null) {
builder.connectTimeout(connectTimeout, TimeUnit.MILLISECONDS);
}
Long readTimeout = restClientConfig.readTimeout().orElse(this.configRoot.readTimeout());
if (readTimeout != null) {
builder.readTimeout(readTimeout, TimeUnit.MILLISECONDS);
}
}
protected void configureBaseUrl(RestClientBuilder builder) {
Optional<String> baseUrlOptional = oneOf(restClientConfig.uriReload(), restClientConfig.urlReload());
if (((baseUriFromAnnotation == null) || baseUriFromAnnotation.isEmpty()) && baseUrlOptional.isEmpty()) {View on GitHub (pinned to e1c734241f)
Solutions
- Correct the fully-qualified class name in the providers config property or annotation
- Add the module/dependency containing the provider to the runtime classpath
- Search the codebase for the class to confirm its current package and name
- If the provider belongs to a library, add the artifact that ships it rather than assuming transitive availability
Example fix
// before (application.properties) quarkus.rest-client.inventory.providers=com.example.old.AuthFilter // after quarkus.rest-client.inventory.providers=com.example.rest.AuthFilter
Defensive patterns
Strategy: validation
Validate before calling
// verify provider classes exist before startup
String providers = ConfigProvider.getConfig()
.getValue("quarkus.rest-client.my-client.providers", String.class);
for (String name : providers.split(",")) {
Class.forName(name.trim(), false, Thread.currentThread().getContextClassLoader()); // throws if absent
} Prevention
- Keep provider FQCNs in constants next to the client interface
- Add an integration test that resolves every configured provider class
- Re-check providers config after any dependency upgrade or refactor
- Avoid providers from test/provided-scoped dependencies in production config
When it happens
Trigger: A class listed in quarkus.rest-client.<key>.providers=com.example.MyFilter does not exist at runtime — typo, missing Maven dependency, or the class lives in a test/dev-only module.
Common situations: Renaming/refactoring a provider class without updating the config property; provider contributed by a dependency marked <scope>provided</scope> or only in the test classpath; fully-qualified name with wrong package after a package move.
Related errors
- Unable to find class for provider ${providerToRegister}
- Multiple RestClientBuilderFactory implementations found: ${s
- Failed to initialize trust store from classpath resource ${t
- Classpath resource ${path} not found for MicroProfile Rest C
- Class ${className} used in ${annotationName} on ${declaringC
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/4762233508adefc3.
Report an issue: GitHub.