oracle/graal · error · IllegalArgumentException

Must not call isAutomatic() on an unnamed module

Error message

Must not call isAutomatic() on an unnamed module

What it means

Error "Must not call isAutomatic() on an unnamed module" thrown in oracle/graal.

Source

Thrown at compiler/src/jdk.graal.compiler.hostvmaccess/src/jdk/graal/compiler/hostvmaccess/HostVMResolvedJavaModuleImpl.java:103

    @Override
    public boolean isExported(String packageName, ResolvedJavaModule accessingModule) {
        return module.isExported(packageName, toImpl(accessingModule).module);
    }

    @Override
    public Set<String> getPackages() {
        return module.getPackages();
    }

    @Override
    public boolean isNamed() {
        return module.isNamed();
    }

    @Override
    public boolean isAutomatic() {
        if (!isNamed()) {
            throw new IllegalArgumentException("Must not call isAutomatic() on an unnamed module");
        }
        return module.getDescriptor().isAutomatic();
    }

    private static HostVMResolvedJavaModuleImpl toImpl(ResolvedJavaModule module) {
        if (module instanceof HostVMResolvedJavaModuleImpl moduleImpl) {
            return moduleImpl;
        }
        throw new IllegalArgumentException("Unsupported ResolvedJavaModule implementation: " + module.getClass().getName());
    }

    /**
     * Updates a {@code accessingModule} to read {@code this} module during the image build. This
     * method is not meant to change any runtime property of {@code this} module. This method is
     * accessed reflectively.
     */
    void addReads(Module accessingModule) {
        ModuleSupport.addOpens(accessingModule, toImpl(this).module);

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Fix the condition reported by the error: Must not call isAutomatic() on an unnamed module
  2. Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call.

Example fix

Validate inputs and environment so that the failing condition does not occur: Must not call isAutomatic() on an unnamed module

When it happens

Trigger: Thrown at compiler/src/jdk.graal.compiler.hostvmaccess/src/jdk/graal/compiler/hostvmaccess/HostVMResolvedJavaModuleImpl.java:103 when the library encounters an invalid state.

Common situations: Occurs when a caller violates the contract guarded by this check: Must not call isAutomatic() on an unnamed module


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/3aa0421bd6275157. Report an issue: GitHub.