quarkusio/quarkus · error · RuntimeException
Could not find provider class: " + name
Error message
Could not find provider class: " + name
What it means
Thrown by RestClientCDIDelegateBuilder.providerClassForName when a JAX-RS provider class name configured for the rest client (via @RegisterProvider or registerProviders) cannot be loaded with Class.forName using the thread-context classloader. The configured class name does not exist on the classpath, and the original ClassNotFoundException is wrapped into a RuntimeException.
Source
Thrown at extensions/resteasy-reactive/rest-client/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/RestClientCDIDelegateBuilder.java:397
private void configureProviders(QuarkusRestClientBuilder builder) {
Optional<String> maybeProviders = oneOf(restClientConfig.providers(), configRoot.providers());
if (maybeProviders.isPresent()) {
registerProviders(builder, maybeProviders.get());
}
}
private void registerProviders(QuarkusRestClientBuilder 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);
}
}
private void configureTimeouts(QuarkusRestClientBuilder 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);
}
}
private void configureBaseUrl(QuarkusRestClientBuilder builder) {
Optional<String> propertyOptional = oneOf(restClientConfig.uriReload(), restClientConfig.urlReload());
if (((baseUriFromAnnotation == null) || baseUriFromAnnotation.isEmpty())View on GitHub (pinned to e1c734241f)
Solutions
- Check the providers config value and correct the fully-qualified class name (verify with an import in code or the jar's contents)
- Add the dependency that contains the provider class to the application (verify with mvn dependency:tree and by locating the class in the jar)
- If the provider was removed/renamed in an upgrade, replace it with the new class or drop it from the list
- Prefer @RegisterProvider(MyProvider.class) on the interface over string-based config so typos fail at compile time
Example fix
// before (application.properties) quarkus.rest-client.myservice.providers=com.example.auth.AuthFilter // after (class moved packages) quarkus.rest-client.myservice.providers=com.example.rest.AuthFilter
Defensive patterns
Strategy: validation
Validate before calling
String providers = "com.example.MyFilter"; Class.forName(providers, true, Thread.currentThread().getContextClassLoader()); // throws ClassNotFoundException early if missing
Try / catch
try {
MyClient client = Arc.container().instance(MyClient.class).get();
} catch (RuntimeException e) {
if (e.getMessage() != null && e.getMessage().startsWith("Could not find provider class")) {
throw new ConfigurationException("Provider class missing from classpath — fix providers config or add dependency", e);
}
throw e;
} Prevention
- Prefer @RegisterProvider(Class) on the interface over string-based providers config for compile-time safety
- Keep provider FQNs in sync when refactoring packages
- Run a build-time check (mvn dependency:tree + jar tf) that the provider class is on the classpath
When it happens
Trigger: A provider class name set via quarkus.rest-client.<key>.providers (or @RegisterProvider / MP Rest Client 'providers' property) references a class that is not on the runtime classpath, or is misspelled / uses the wrong fully-qualified name (e.g. missing package or old package after a library upgrade).
Common situations: Registering a provider like org.example.MyFilter without adding the module/jar providing it to dependencies; renaming or moving the provider class and forgetting to update the config property; upgrading a library whose provider FQN changed; typos in the comma-separated providers list.
Related errors
- Can't load class: <settingStringValue>
- Could not find hostname verifier class " + verifier
- Classpath resource " + path + " not found for MicroProfile R
- RuntimeException(e)
- RuntimeException(e)
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/b237e052bb41f6eb.
Report an issue: GitHub.