quarkusio/quarkus · error · RuntimeException

RuntimeException(e)

Error message

RuntimeException(e)

What it means

Thrown during QuarkusCloudEventsFunction.setDelegate when the class named by the quarkus.google-cloud-functions.deployment selected-delegate property cannot be loaded via Class.forName. It means the configured delegate class name does not exist on the delegate classloader.

Source

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

                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 = (CloudEventsFunction) Arc.container().instance(clazz).get();
            } catch (ClassNotFoundException e) {
                throw new RuntimeException(e);
            }
        }
    }

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

    @Override
    public void accept(CloudEvent cloudEvent) throws Exception {
        if (!started) {
            throw new IOException(deploymentStatus);
        }

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

View on GitHub (pinned to e1c734241f)

Solutions

  1. Fix the fully-qualified class name in application.properties to exactly match your CloudEventsFunction implementation
  2. Confirm the class is included in the built uber-jar (quarkus.package.jar.type=uber-jar)
  3. Rebuild the project after any package rename so the generated metadata matches the new class name

Example fix

# before
quarkus.google-cloud-functions.ce-function=io.acme.MyCloudFucntion
# after
quarkus.google-cloud-functions.ce-function=io.acme.MyCloudFunction
Defensive patterns

Strategy: validation

Validate before calling

// at startup, before deploy
String cls = "com.example.MyCloudEventsFunction";
try {
    Class.forName(cls);
} catch (ClassNotFoundException e) {
    throw new IllegalStateException("Delegate class not on classpath: " + cls);
}

Try / catch

try {
    QuarkusCloudEventsFunction.setDelegate(name);
} catch (RuntimeException e) {
    if (e.getCause() instanceof ClassNotFoundException cnfe) {
        throw new IllegalStateException("Check quarkus.google-cloud-functions config: " + cnfe.getMessage());
    }
    throw e;
}

Prevention

When it happens

Trigger: quarkus.google-cloud-functions... selected delegate property (application.properties) points to a class name that is misspelled, renamed, or not present in the deployed uber-jar when setDelegate runs.

Common situations: Typo in the fully-qualified class name in application.properties, refactoring/renaming the CloudEventsFunction class without updating the property, or the class being in a module not packaged in the function uber-jar.

Related errors


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