quarkusio/quarkus · error · RuntimeException

Failed to set dev services config

Error message

Failed to set dev services config

What it means

After Dev Services start, StartupActionImpl reflectively injects the resulting config map into DevServicesConfigSource in the runtime class loader. If class loading succeeded but the reflective invocation fails (missing setConfig method, wrong signature, target threw), the code wraps it in RuntimeException("Failed to set dev services config").

Source

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

                throw new IllegalStateException("Dev services cannot be started without a deployment class loader.");
            }
            DevServicesRegistryBuildItem.DevServicesStartResult startResult = devServicesRegistry.startAll(
                    devServicesResults, devServicesCustomizers, additionalConfigBuildItems, deploymentClassLoader);

            devServicesProperties.putAll(startResult.configs());
            setDevServicesConfigSourceValues(startResult);
        }
    }

    private void setDevServicesConfigSourceValues(DevServicesRegistryBuildItem.DevServicesStartResult startResult) {
        try {
            Class<?> configSourceClass = runtimeClassLoader
                    .loadClass("io.quarkus.devservice.runtime.config.DevServicesConfigSource");
            configSourceClass.getMethod("setConfig", Map.class).invoke(null, startResult.configs());
        } catch (ClassNotFoundException e) {
            // devservices runtime module not available
        } catch (ReflectiveOperationException e) {
            throw new RuntimeException("Failed to set dev services config", e);
        }

        try {
            Class<?> overrideConfigSourceClass = runtimeClassLoader
                    .loadClass("io.quarkus.devservice.runtime.config.DevServicesOverrideConfigSource");
            overrideConfigSourceClass.getMethod("setConfig", Map.class).invoke(null, startResult.overrideConfigs());
        } catch (ClassNotFoundException e) {
            // devservices runtime module not available
        } catch (ReflectiveOperationException e) {
            throw new RuntimeException("Failed to set dev services override config", e);
        }
    }

    /**
     * Runs the application, and returns a handle that can be used to shut it down.
     */
    public RunningQuarkusApplication run(String... args) throws Exception {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Rebuild with a consistent Quarkus version (mvn clean install) so deployment and devservices runtime modules match
  2. Verify DevServicesConfigSource exposes a static setConfig(Map) method in your Quarkus version
  3. Inspect the wrapped cause (e.getCause()) for the real reflective failure
  4. Clear stale local artifacts of the io.quarkus devservice modules and re-resolve dependencies
Defensive patterns

Strategy: try-catch

Validate before calling

try {
    Class.forName("io.quarkus.devservice.runtime.config.DevServicesConfigSource", true, runtimeClassLoader);
} catch (ClassNotFoundException e) {
    // devservices runtime module missing; skip config injection
}

Try / catch

try { action.run(); } catch (RuntimeException e) { if ("Failed to set dev services config".equals(e.getMessage())) { log.error("dev services config injection failed", e.getCause()); } else { throw e; } }

Prevention

When it happens

Trigger: Mismatch between the core deployment code and io.quarkus.devservice.runtime.config.DevServicesConfigSource — e.g. mixed Quarkus versions on the classpath where setConfig(Map) does not exist, or the method itself throwing during invocation.

Common situations: Upgrading core Quarkus without rebuilding/reloading dev extensions; custom builds of the devservices runtime module; parallel Quarkus versions in the local Maven repository.

Related errors


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