quarkusio/quarkus · error · RuntimeException

RuntimeException(e)

Error message

RuntimeException(e)

What it means

Thrown during QuarkusHttpFunction.setDelegate when the class name configured as the selected HttpFunction delegate cannot be loaded via Class.forName from the delegate classloader. It is a wrapper around ClassNotFoundException indicating a bad or stale delegate class name.

Source

Thrown at extensions/google-cloud-functions/runtime/src/main/java/io/quarkus/gcp/functions/QuarkusHttpFunction.java:58

                ex.printStackTrace(errorWriter);
            } finally {
                Thread.currentThread().setContextClassLoader(currentCl);
            }
        } else {
            errorWriter.println("Quarkus bootstrapped successfully.");
            started = true;
        }
        deploymentStatus = error.toString();
    }

    static void setDelegate(String selectedDelegate) {
        if (selectedDelegate != null) {
            delegateClassLoader = Thread.currentThread().getContextClassLoader();
            try {
                Class<?> clazz = Class.forName(selectedDelegate, false, delegateClassLoader);
                delegate = (HttpFunction) Arc.container().instance(clazz).get();
            } catch (ClassNotFoundException e) {
                throw new RuntimeException(e);
            }
        }
    }

    static void clearState() {
        delegate = null;
        delegateClassLoader = null;
    }

    @Override
    public void service(HttpRequest httpRequest, HttpResponse httpResponse) throws Exception {
        if (!started) {
            throw new IOException(deploymentStatus);
        }

        // maybe we can check this at static init
        if (delegate == null) {
            throw new IOException("We didn't found any HttpFunction to run " +

View on GitHub (pinned to e1c734241f)

Solutions

  1. Correct the fully-qualified class name of the HttpFunction in application.properties
  2. Rebuild the uber-jar so the class is present at deploy time
  3. If you renamed the class, update any generated function entry-point config that referenced the old name

Example fix

# before
quarkus.google-cloud-functions.function=io.acme.MyHttpFuntion
# after
quarkus.google-cloud-functions.function=io.acme.MyHttpFunction
Defensive patterns

Strategy: validation

Validate before calling

String cls = "com.example.MyHttpFunction";
try {
    Class.forName(cls);
} catch (ClassNotFoundException e) {
    throw new IllegalStateException("HttpFunction delegate not found: " + cls);
}

Try / catch

try {
    QuarkusHttpFunction.setDelegate(name);
} catch (RuntimeException e) {
    if (e.getCause() instanceof ClassNotFoundException cnfe) {
        throw new IllegalStateException("Bad delegate class name in config: " + cnfe.getMessage());
    }
    throw e;
}

Prevention

When it happens

Trigger: The configured selected-delegate property for HTTP functions references a class that is misspelled, was renamed, or is absent from the deployed uber-jar.

Common situations: Typos in application.properties, refactoring the HttpFunction class without updating config, deploying a thin jar or artifact that does not contain the class.

Related errors


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