{"record":{"id":"24478eb1642ecf0a","repo":"quarkusio/quarkus","slug":"runtimeexception-e-24478e","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/QuarkusHttpFunction.java","lineNumber":58,"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 = (HttpFunction) Arc.container().instance(clazz).get();\n            } catch (ClassNotFoundException e) {\n                throw new RuntimeException(e);\n            }\n        }\n    }\n\n    static void clearState() {\n        delegate = null;\n        delegateClassLoader = null;\n    }\n\n    @Override\n    public void service(HttpRequest httpRequest, HttpResponse httpResponse) throws Exception {\n        if (!started) {\n            throw new IOException(deploymentStatus);\n        }\n\n        // maybe we can check this at static init\n        if (delegate == null) {\n            throw new IOException(\"We didn't found any HttpFunction to run \" +","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/google-cloud-functions/runtime/src/main/java/io/quarkus/gcp/functions/QuarkusHttpFunction.java#L40-L76","documentation":"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.","triggerScenarios":"The configured selected-delegate property for HTTP functions references a class that is misspelled, was renamed, or is absent from the deployed uber-jar.","commonSituations":"Typos in application.properties, refactoring the HttpFunction class without updating config, deploying a thin jar or artifact that does not contain the class.","solutions":["Correct the fully-qualified class name of the HttpFunction in application.properties","Rebuild the uber-jar so the class is present at deploy time","If you renamed the class, update any generated function entry-point config that referenced the old name"],"exampleFix":"# before\nquarkus.google-cloud-functions.function=io.acme.MyHttpFuntion\n# after\nquarkus.google-cloud-functions.function=io.acme.MyHttpFunction","handlingStrategy":"validation","validationCode":"String cls = \"com.example.MyHttpFunction\";\ntry {\n    Class.forName(cls);\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\"HttpFunction delegate not found: \" + cls);\n}","typeGuard":null,"tryCatchPattern":"try {\n    QuarkusHttpFunction.setDelegate(name);\n} catch (RuntimeException e) {\n    if (e.getCause() instanceof ClassNotFoundException cnfe) {\n        throw new IllegalStateException(\"Bad delegate class name in config: \" + cnfe.getMessage());\n    }\n    throw e;\n}","preventionTips":["Use the exact FQCN from the IDE when setting the delegate property","Re-check the property after refactors that move or rename the class","Verify the built uber-jar contains the class (jar tf)","Cover delegate loading in an integration test"],"tags":["gcp","classpath","configuration","http-function"],"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-14T00:17:10.932Z"}