quarkusio/quarkus · error · RuntimeException

Unable to find class for provider ${providerToRegister}

Error message

Unable to find class for provider ${providerToRegister}

What it means

RestClientRecorder.registerProviders() runs at build/startup time and loads each configured provider class via the runtime ClassLoader; ClassNotFoundException is wrapped in this RuntimeException naming the missing provider. Unlike RestClientBase.providerClassForName, this executes in the recorder during application start, so the app fails to boot.

Source

Thrown at extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/RestClientRecorder.java:74

        if (useBuiltIn) {
            RegisterBuiltin.register(providerFactory);
        } else {
            providersToRegister.removeAll(contributedProviders);
            registerProviders(providerFactory, providersToRegister, true);
        }
        registerProviders(providerFactory, contributedProviders, false);
    }

    private static void registerProviders(ResteasyProviderFactory providerFactory, Set<String> providersToRegister,
            Boolean isBuiltIn) {
        for (String providerToRegister : providersToRegister) {
            try {
                providerFactory
                        .registerProvider(
                                Thread.currentThread().getContextClassLoader().loadClass(providerToRegister.trim()),
                                isBuiltIn);
            } catch (ClassNotFoundException e) {
                throw new RuntimeException("Unable to find class for provider " + providerToRegister, e);
            }
        }
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Fix or remove the offending entry in quarkus.rest-client.<key>.providers
  2. Add the artifact containing the provider class as a runtime dependency
  3. Inspect the dependency jar (jar tf <artifact>.jar | grep <Class>) to confirm the exact name after upgrades
  4. Migrate to the replacement class per the library's upgrade notes

Example fix

// before (application.properties)
quarkus.rest-client.audit.providers=org.jboss.resteasy.client.jackson.ResteasyJacksonJacksonProvider
// after — corrected class name
quarkus.rest-client.audit.providers=com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider
Defensive patterns

Strategy: validation

Validate before calling

// verify recorder-time provider names resolve before deploying
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());
}

Prevention

When it happens

Trigger: quarkus.rest-client.<key>.providers (or the global quarkus.rest-client.providers) contains a class name that the runtime ClassLoader cannot load — dependency missing from the runtime module, name typo, or class removed/renamed by a version upgrade.

Common situations: Upgrading a library that renamed/moved its filter or feature class; provider registered for the classic client but living in a reactive-only artifact; shade plugin excluding the class from the final jar.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/128697d34336e25d. Report an issue: GitHub.