{"record":{"id":"77daf77fb65f3bc7","repo":"quarkusio/quarkus","slug":"quarkus-initialization-error","errorCode":null,"errorMessage":"Quarkus initialization error","messagePattern":"Quarkus initialization error","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"extensions/amazon-lambda/common-runtime/src/main/java/io/quarkus/amazon/lambda/runtime/AbstractLambdaPollLoop.java","lineNumber":255,"sourceCode":"     * @throws Exception\n     */\n    protected abstract Object processRequest(Object input, AmazonLambdaContext context) throws Exception;\n\n    protected abstract void processRequest(InputStream input, OutputStream output, AmazonLambdaContext context)\n            throws Exception;\n\n    protected abstract LambdaInputReader getInputReader();\n\n    protected abstract LambdaOutputWriter getOutputWriter();\n\n    protected AmazonLambdaContext createContext(HttpURLConnection requestConnection) throws IOException {\n        return new AmazonLambdaContext(requestConnection, cognitoIdReader, clientCtxReader);\n    }\n\n    private void checkQuarkusBootstrapped() {\n        // todo we need a better way to do this.\n        if (Application.currentApplication() == null) {\n            throw new RuntimeException(\"Quarkus initialization error\");\n        }\n        String[] args = {};\n        Application.currentApplication().start(args);\n    }\n\n    protected void postResponse(URL url, Object response) throws IOException {\n        HttpURLConnection responseConnection = (HttpURLConnection) url.openConnection();\n        responseConnection.setRequestProperty(USER_AGENT, USER_AGENT_VALUE);\n        if (response != null) {\n            getOutputWriter().writeHeaders(responseConnection);\n        }\n        responseConnection.setDoOutput(true);\n        responseConnection.setRequestMethod(\"POST\");\n        if (response != null) {\n            getOutputWriter().writeValue(responseConnection.getOutputStream(), response);\n        }\n        while (responseConnection.getInputStream().read() != -1) {\n            // Read data","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/amazon-lambda/common-runtime/src/main/java/io/quarkus/amazon/lambda/runtime/AbstractLambdaPollLoop.java#L237-L273","documentation":"The Lambda poll loop checks that the Quarkus Application has been bootstrapped before processing events; Application.currentApplication() is null, meaning Quarkus never started. The runtime then also calls start() on the current application for each run.","triggerScenarios":"checkQuarkusBootstrapped() is invoked from run() when Application.currentApplication() returns null, i.e. the lambda handler was invoked without Quarkus having initialized the application lifecycle.","commonSituations":"Deploying a handler class that bypasses Quarkus's generated handler (e.g. configuring AWS Lambda handler to the raw class instead of io.quarkus.amazon.lambda.runtime.QuarkusStreamHandler/QuarkusEventHandler); packaging that stripped the Quarkus bootstrap; JVM Lambda with a custom main that never ran the Quarkus app.","solutions":["Set the Lambda console/CLI handler to the Quarkus-provided handler (io.quarkus.amazon.lambda.runtime.QuarkusStreamHandler::streamHandler or the event variant) instead of your own class","Package via the Quarkus Amazon Lambda packaging (mvn package producing function.zip) so the bootstrap entry point is included","Ensure the archive's bootstrap/main invokes the Quarkus application (run the generated handler, not a custom main)","Verify you are not subclassing RequestHandler and invoking it manually outside the Quarkus runtime"],"exampleFix":"# before (AWS Lambda config)\nHandler: com.acme.MyHandler::handleRequest\n// after\nHandler: io.quarkus.amazon.lambda.runtime.QuarkusStreamHandler::streamHandler","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { loop.run(); } catch (RuntimeException e) { if (\"Quarkus initialization error\".equals(e.getMessage())) { /* reconfigure Lambda handler to QuarkusStreamHandler / republish function.zip */ } throw e; }","preventionTips":["Point the AWS Lambda Handler config at the Quarkus-provided handler class","Deploy the function.zip produced by Quarkus packaging, not a hand-made jar","Do not wrap Quarkus Lambda handlers in custom mains that skip Application bootstrap","Test locally with the AWS SAM/Quarkus lambda dev mode"],"tags":["quarkus","amazon-lambda","startup","lifecycle"],"backgroundTag":"application-not-bootstrapped","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"}