quarkusio/quarkus · error · java.lang.UnsupportedOperationException

JDK HTTP adapter is not available in native mode. Please use

Error message

JDK HTTP adapter is not available in native mode. Please use the Vertx adapter by setting the HTTP adapter type to VERTX in your RegistryClientOptions or configuration.

What it means

In native (GraalVM) mode, the Apicurio Registry client's JDK HTTP adapter (kiota-http-jdk) is not reachable in the Quarkus substitution layer, so Substitutions.createJdkAdapter() deliberately throws UnsupportedOperationException. Only the Vert.x HTTP adapter is supported for native-image builds.

Source

Thrown at extensions/schema-registry/apicurio/common/runtime/src/main/java/io/quarkus/apicurio/registry/graal/Substitutions.java:38

@TargetClass(className = "io.apicurio.registry.client.common.RegistryClientRequestAdapterFactory")
final class Target_RegistryClientRequestAdapterFactory {

    @Substitute
    static Vertx getVertxFromCDI(String CDIClassName, String InstanceClassName) {
        try {
            return Arc.container().instance(Vertx.class).get();
        } catch (Throwable t) {
            // Log and ignore
            return null;
        }
    }

    @Substitute
    private static RequestAdapter createJdkAdapter(RegistryClientOptions options) {
        // JDK HTTP adapter is not supported in native mode because kiota-http-jdk is excluded.
        // Use Vertx adapter instead by setting the adapter type in RegistryClientOptions.
        throw new UnsupportedOperationException(
                "JDK HTTP adapter is not available in native mode. Please use the Vertx adapter by setting " +
                        "the HTTP adapter type to VERTX in your RegistryClientOptions or configuration.");
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Set the HTTP adapter type to VERTX in RegistryClientOptions (options.setHttpAdapterType(AdapterType.VERTX)).
  2. Set the adapter via configuration (e.g. the apicurio client http.adapter property) to VERTX before building native.
  3. If JDK adapter is genuinely required, run the application in JVM mode instead of native.
  4. Upgrade the Quarkus Apicurio extension in case newer versions support additional native adapters.

Example fix

// before
RegistryClientOptions options = new RegistryClientOptions();
options.setHttpAdapterType(AdapterType.JDK);
// after
RegistryClientOptions options = new RegistryClientOptions();
options.setHttpAdapterType(AdapterType.VERTX);
Defensive patterns

Strategy: validation

Validate before calling

if (options.getHttpAdapterType() == AdapterType.JDK && isNativeImage()) {
    options.setHttpAdapterType(AdapterType.VERTX);
}

Try / catch

try {
    client = registryClientFactory.create(options);
} catch (UnsupportedOperationException e) {
    if (e.getMessage().contains("JDK HTTP adapter")) {
        options.setHttpAdapterType(AdapterType.VERTX);
        client = registryClientFactory.create(options);
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Running a native-image build/execution of an application whose RegistryClientOptions set the HTTP adapter type to JDK (explicitly or via configuration), causing the substituted factory to be invoked at runtime in native mode.

Common situations: Setting quarkus.apicurio-registry or RegistryClientOptions adapter type to JDK because it worked in JVM mode; default client settings changed across Apicurio client versions; copying JVM-mode client configuration into a native build.

Related errors


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