{"record":{"id":"7463f1d9a93cc558","repo":"quarkusio/quarkus","slug":"dev-services-cannot-be-started-without-a-deploymen","errorCode":null,"errorMessage":"Dev services cannot be started without a deployment class loader.","messagePattern":"Dev services cannot be started without a deployment class loader\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/runner/bootstrap/StartupActionImpl.java","lineNumber":340,"sourceCode":"                URL url = resources.nextElement();\n                if (url.toString().contains(STARTUP_OVERRIDE.getName())) {\n                    writeTempApplicationProperties(url.toURI(), config, STARTUP_OVERRIDE);\n                    break;\n                }\n            }\n        } catch (IOException | URISyntaxException e) {\n            throw new RuntimeException(e);\n        }\n    }\n\n    private void ensureDevServicesStarted() {\n        if (devServicesStarted) {\n            return;\n        }\n        devServicesStarted = true;\n        if (devServicesRegistry != null) {\n            if (deploymentClassLoader == null) {\n                throw new IllegalStateException(\"Dev services cannot be started without a deployment class loader.\");\n            }\n            DevServicesRegistryBuildItem.DevServicesStartResult startResult = devServicesRegistry.startAll(\n                    devServicesResults, devServicesCustomizers, additionalConfigBuildItems, deploymentClassLoader);\n\n            devServicesProperties.putAll(startResult.configs());\n            setDevServicesConfigSourceValues(startResult);\n        }\n    }\n\n    private void setDevServicesConfigSourceValues(DevServicesRegistryBuildItem.DevServicesStartResult startResult) {\n        try {\n            Class<?> configSourceClass = runtimeClassLoader\n                    .loadClass(\"io.quarkus.devservice.runtime.config.DevServicesConfigSource\");\n            configSourceClass.getMethod(\"setConfig\", Map.class).invoke(null, startResult.configs());\n        } catch (ClassNotFoundException e) {\n            // devservices runtime module not available\n        } catch (ReflectiveOperationException e) {\n            throw new RuntimeException(\"Failed to set dev services config\", e);","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/runner/bootstrap/StartupActionImpl.java#L322-L358","documentation":"StartupActionImpl.ensureDevServicesStarted() starts Dev Services (automatic containers for databases, brokers, etc.) during dev/test runs. Dev Services must run inside the deployment class loader; if it is null the framework cannot proceed and throws this error instead of failing opaquely later.","triggerScenarios":"Calling run(), runMainClass(), runMainClassBlocking(), or the Dev Services property accessors (getOrInitialiseDevServicesProperties/NetworkId) on a StartupActionImpl whose deployment class loader was never set — e.g. a StartupAction created without a deployment classpath or after its loader was released.","commonSituations":"Embedded/bootstrapped Quarkus launches in dev mode where the deployment class loader was not created; calling StartupAction APIs after the deployment class loader was closed; misconfigured custom test harnesses.","solutions":["Obtain the StartupAction via AugmentAction.createInitialRuntimeApplication() so the deployment class loader is established","Keep the deployment class loader open for the lifetime of dev-mode runs; do not close it before starting dev services","If Dev Services are not needed, disable them (quarkus.devservices.enabled=false) to skip this path","Re-run the dev bootstrap from scratch if the loader was already closed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before invoking dev-mode run paths\nboolean devServicesEnabled = Boolean.parseBoolean(config.get(\"quarkus.devservices.enabled\", \"true\"));\nif (devServicesEnabled && deploymentClassLoader == null) {\n    throw new IllegalStateException(\"Dev services require a deployment class loader; use createInitialRuntimeApplication()\");\n}","typeGuard":null,"tryCatchPattern":"try { startupAction.run(); } catch (IllegalStateException e) { if (e.getMessage().contains(\"deployment class loader\")) { /* recreate StartupAction via augment action */ } else { throw e; } }","preventionTips":["Create StartupAction via AugmentAction.createInitialRuntimeApplication()","Do not close the deployment class loader while dev services are needed","Disable quarkus.devservices.enabled when no containers are wanted"],"tags":["quarkus","dev-services","classloading"],"backgroundTag":"dev-services-startup-failed","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"}