{"record":{"id":"0591784ea23754f7","repo":"quarkusio/quarkus","slug":"runtimeexception-e-059178","errorCode":null,"errorMessage":"RuntimeException(e)","messagePattern":"RuntimeException\\(e\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/google-cloud-functions/runtime/src/main/java/io/quarkus/gcp/functions/QuarkusCloudEventsFunction.java","lineNumber":57,"sourceCode":"                ex.printStackTrace(errorWriter);\n            } finally {\n                Thread.currentThread().setContextClassLoader(currentCl);\n            }\n        } else {\n            errorWriter.println(\"Quarkus bootstrapped successfully.\");\n            started = true;\n        }\n        deploymentStatus = error.toString();\n    }\n\n    static void setDelegate(String selectedDelegate) {\n        if (selectedDelegate != null) {\n            delegateClassLoader = Thread.currentThread().getContextClassLoader();\n            try {\n                Class<?> clazz = Class.forName(selectedDelegate, false, delegateClassLoader);\n                delegate = (CloudEventsFunction) Arc.container().instance(clazz).get();\n            } catch (ClassNotFoundException e) {\n                throw new RuntimeException(e);\n            }\n        }\n    }\n\n    public static void clearState() {\n        delegate = null;\n        delegateClassLoader = null;\n    }\n\n    @Override\n    public void accept(CloudEvent cloudEvent) throws Exception {\n        if (!started) {\n            throw new IOException(deploymentStatus);\n        }\n\n        // TODO maybe we can check this at static init\n        if (delegate == null) {\n            throw new IOException(\"We didn't found any CloudEventsFunction to run \" +","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/google-cloud-functions/runtime/src/main/java/io/quarkus/gcp/functions/QuarkusCloudEventsFunction.java#L39-L75","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Fix the fully-qualified class name in application.properties to exactly match your CloudEventsFunction implementation","Confirm the class is included in the built uber-jar (quarkus.package.jar.type=uber-jar)","Rebuild the project after any package rename so the generated metadata matches the new class name"],"exampleFix":"# before\nquarkus.google-cloud-functions.ce-function=io.acme.MyCloudFucntion\n# after\nquarkus.google-cloud-functions.ce-function=io.acme.MyCloudFunction","handlingStrategy":"validation","validationCode":"// at startup, before deploy\nString cls = \"com.example.MyCloudEventsFunction\";\ntry {\n    Class.forName(cls);\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\"Delegate class not on classpath: \" + cls);\n}","typeGuard":null,"tryCatchPattern":"try {\n    QuarkusCloudEventsFunction.setDelegate(name);\n} catch (RuntimeException e) {\n    if (e.getCause() instanceof ClassNotFoundException cnfe) {\n        throw new IllegalStateException(\"Check quarkus.google-cloud-functions config: \" + cnfe.getMessage());\n    }\n    throw e;\n}","preventionTips":["Copy the fully-qualified class name from the IDE, never type it by hand","Grep application.properties for the delegate property after any package rename","Confirm the class is in target/*-runner.jar (uber-jar) with jar tf","Add a startup smoke test that loads the configured class by name"],"tags":["gcp","classpath","configuration","cloudevents"],"backgroundTag":"class-not-found","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}