{"record":{"id":"a4be76b80131d2a9","repo":"oracle/graal","slug":"could-not-find-module-s-in-the-boot-layer","errorCode":null,"errorMessage":"Could not find module %s in the boot layer","messagePattern":"Could not find module (.+?) in the boot layer","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/ModuleSupport.java","lineNumber":62,"sourceCode":"                        \"jdk.vm.ci.meta.annotation\",\n                        \"jdk.vm.ci.code\");\n        ModuleSupport.addExports(VMAccess.class, \"jdk.graal.compiler\",\n                        \"jdk.graal.compiler.annotation\",\n                        \"jdk.graal.compiler.phases.util\");\n        ModuleSupport.addExports(VMAccess.class, \"java.base\", \"sun.reflect.annotation\");\n    }\n\n    private ModuleSupport() {\n    }\n\n    public static void addExports(Class<?> accessingModuleClass, String targetModuleName, String... packageNames) {\n        addExports(accessingModuleClass.getModule(), targetModuleName, packageNames);\n    }\n\n    public static void addExports(String accessingModuleName, String targetModuleName, String... packageNames) {\n        Optional<Module> maybeModule = ModuleLayer.boot().findModule(accessingModuleName);\n        if (maybeModule.isEmpty()) {\n            throw new IllegalStateException(\"Could not find module \" + accessingModuleName + \" in the boot layer\");\n        }\n        addExports(maybeModule.get(), targetModuleName, packageNames);\n    }\n\n    public static void addExports(Module accessingModule, String targetModuleName, String... packageNames) {\n        Optional<Module> maybeModule = ModuleLayer.boot().findModule(targetModuleName);\n        if (maybeModule.isEmpty()) {\n            throw new IllegalStateException(\"Could not find module \" + targetModuleName + \" in the boot layer\");\n        }\n        addExports(accessingModule, maybeModule.get(), packageNames);\n    }\n\n    public static void addExports(Module accessingModule, Module targetModule, String... packageNames) {\n        for (String packageName : packageNames) {\n            Modules.addExports(targetModule, packageName, accessingModule);\n        }\n    }\n","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/ModuleSupport.java#L44-L80","documentation":"Error \"Could not find module %s in the boot layer\" thrown in oracle/graal.","triggerScenarios":"Thrown at compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/ModuleSupport.java:62 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Could not find module {} in the boot layer","solutions":["Fix the condition reported by the error: Could not find module {} in the boot layer","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Could not find module {} in the boot layer","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}