quarkusio/quarkus · critical

Failed to start Quarkus

Error message

Failed to start Quarkus

What it means

When StartupActionImpl.run() invokes the application's main class reflectively, the invoked code itself throws. Non-Exception Throwables (e.g. Errors like NoClassDefFoundError, StackOverflowError) cannot be rethrown as Exception, so they are wrapped in RuntimeException("Failed to start Quarkus") with the original cause attached.

Source

Thrown at core/deployment/src/main/java/io/quarkus/runner/bootstrap/StartupActionImpl.java:450

                        }
                        // This will read the state of the curated application at the time of closing;
                        // If the caller of close knows that the 'next' application shares a curated application, it can set eligible for reuse to true
                        if (!curatedApplication.isEligibleForReuse()) {
                            if (curatedApplication.getQuarkusBootstrap().getMode() == QuarkusBootstrap.Mode.TEST
                                    && !curatedApplication.getQuarkusBootstrap().isAuxiliaryApplication()) {
                                //for tests, we just always shut down the curated application, as it is only used once
                                //dev mode might be about to restart, so we leave it
                                curatedApplication.close();
                            }
                        }
                    }
                }
            }, runtimeClassLoader);
        } catch (InvocationTargetException e) {
            if (e.getCause() instanceof Exception) {
                throw (Exception) e.getCause();
            }
            throw new RuntimeException("Failed to start Quarkus", e.getCause());
        } finally {
            Thread.currentThread().setContextClassLoader(old);
        }

    }

    @Override
    public QuarkusClassLoader getClassLoader() {
        return runtimeClassLoader;
    }

    @Override
    public Map<String, String> getOrInitialiseDevServicesProperties() {
        ensureDevServicesStarted();
        return devServicesProperties;
    }

    @Override

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read the wrapped getCause() to find the real Error and fix that first
  2. Check for dependency version conflicts (mvn dependency:tree) causing NoClassDefFoundError/LinkageError
  3. Increase JVM memory if the cause is OutOfMemoryError
  4. Clean and rebuild to eliminate stale/incompatible compiled classes
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight: check for known conflicting dependencies
// mvn dependency:tree | grep -i conflicting-library

Try / catch

try { action.run(); } catch (RuntimeException e) { if ("Failed to start Quarkus".equals(e.getMessage())) { Throwable cause = e.getCause(); /* handle Error e.g. NoClassDefFoundError */ } else { throw e; } }

Prevention

When it happens

Trigger: The application's startable main method throws an Error (not an Exception) during startup — e.g. NoClassDefFoundError from a missing or conflicting dependency, LinkageError from incompatible classes, OutOfMemoryError.

Common situations: Duplicate/incompatible library versions causing linkage errors at startup; JVM-level failures (OOM, metaspace) during boot; native-image-incompatible classes touched at startup.

Related errors


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