{"record":{"id":"e4ee9bf13991b64a","repo":"quarkusio/quarkus","slug":"boot-module-listed-in-model-is-missing-from-the-mo","errorCode":null,"errorMessage":"Boot module listed in model is missing from the module index","messagePattern":"Boot module listed in model is missing from the module index","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/packaging/jlink/deployment/src/main/java/io/quarkus/jlink/deployment/JLinkSteps.java","lineNumber":94,"sourceCode":"    public JLinkStagedOutputItem stageOutput(\n            CurateOutcomeBuildItem curateOutcome,\n            ApplicationModuleInfoBuildItem moduleInfoItem) throws IOException {\n\n        // gather information we'll need\n        AppModuleModel model = moduleInfoItem.model();\n        Map<String, ModuleInfo> modulesByName = model.modulesByName();\n\n        // create the staging directory\n        final Path staging = config.outputDirectory().resolve(config.stagingDirectory());\n        Files.createDirectories(staging);\n\n        // create a mapping for each boot module path\n        final Map<String, Path> bmp = new HashMap<>();\n        for (String moduleName : model.bootModules()) {\n            // get this boot module descriptor\n            ModuleInfo moduleInfo = modulesByName.get(moduleName);\n            if (moduleInfo == null) {\n                throw new IllegalStateException(\"Boot module listed in model is missing from the module index\");\n            }\n            // our special launcher module\n            if (moduleName.equals(\"io.quarkus.jlink.launcher\")) {\n                // the list of resources produced by generating the main class\n                List<Resource> dynModuleResources = new ArrayList<>();\n                // generate the simple main class which runs the launcher with the app module info\n                Gizmo gizmo = Gizmo.create((path, bytes) -> dynModuleResources.add(new MemoryResource(path, bytes)));\n                gizmo.class_(APP_MAIN, cc -> {\n                    cc.public_();\n                    cc.staticMethod(\"main\", mc -> {\n                        mc.public_();\n                        ParamVar args = mc.parameter(\"args\", String[].class);\n                        mc.body(b0 -> {\n                            b0.invokeStatic(\n                                    MethodDesc.of(JLinkAppLauncher.class, \"run\", void.class, String.class, String[].class),\n                                    Const.of(moduleInfoItem.model().appModuleInfo().name()),\n                                    args);\n                            b0.return_();","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/packaging/jlink/deployment/src/main/java/io/quarkus/jlink/deployment/JLinkSteps.java#L76-L112","documentation":"During image staging, JLinkSteps.stageOutput builds a map of boot module paths and looks each boot module declared in the modularity model up in the index of resolved modules. If a boot module listed in the model cannot be found among the indexed module descriptors, the build is aborted. This indicates the modularity model and the jlink module index are out of sync.","triggerScenarios":"model.bootModules() contains a module name that has no ModuleInfo entry in modulesByName — e.g. the model recorded a boot module that was never resolved/indexed as a module descriptor during the build steps.","commonSituations":"Custom jlink configuration adding boot modules that do not exist in the application's module graph; a stale or corrupted incremental build where the module index was built with different dependencies; upstream changes to the modular-jlink build items between extensions.","solutions":["Run a clean build (./mvnw clean) to eliminate stale incremental build state","Verify every module listed as a boot module in the jlink configuration actually exists in the application's resolved module graph","Check that jlink extension and modular-jlink build items are from compatible versions (no mixed artifact versions)","Inspect the modularity model build step output to see which boot modules were recorded and why"],"exampleFix":"// before: quarkus.jlink.* config referencing a non-existent module\nquarkus.jlink.add-modules com.myapp.missing.module\n// after: only reference modules that are part of the build\nquarkus.jlink.add-modules com.myapp.existing.module","handlingStrategy":"validation","validationCode":"// before running image packaging, verify boot modules are all resolvable\nSet<String> indexed = modulesByName.keySet();\nList<String> missing = model.bootModules().stream()\n        .filter(m -> !indexed.contains(m))\n        .toList();\nif (!missing.isEmpty()) throw new IllegalStateException(\"Boot modules missing from index: \" + missing);","typeGuard":"boolean isBootModuleIndexed(String name, Map<String, ModuleInfo> modulesByName) {\n    return name != null && modulesByName.containsKey(name);\n}","tryCatchPattern":"try {\n    stageOutput(config, model, modulesByName);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"missing from the module index\")) {\n        throw new IllegalStateException(\"Stale/inconsistent modularity model; run a clean build\", e);\n    }\n    throw e;\n}","preventionTips":["Run clean builds after changing jlink/modularity configuration","Keep boot module lists in sync with the application's resolved module graph","Pin extension versions to avoid mixed modular-jlink artifacts"],"tags":["jlink","build","modularity"],"backgroundTag":"module-not-in-index","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"}