oracle/graal · error · GraalError
Cannot find partial evaluation configuration: %s
Error message
Cannot find partial evaluation configuration: %s
What it means
TruffleCompilerImpl.createPartialEvaluatorConfiguration(name) searches the PartialEvaluatorConfiguration implementations registered via ServiceLoader (GraalServices.load) and matches by name(); no match means the configuration name is unknown to this distribution, and GraalError is thrown.
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleCompilerImpl.java:206
public static final MemUseTrackerKey CodeInstallationMemUse = DebugContext.memUseTracker("TruffleCodeInstallationMemUse");
/**
* Creates a new {@link CompilationIdentifier} for {@code compilable}.
*
* Implementations of this method must guarantee that the {@link Verbosity#ID} for each returned
* value is unique.
*/
public abstract TruffleCompilationIdentifier createCompilationIdentifier(TruffleCompilationTask task, TruffleCompilable compilable);
protected abstract DebugContext createDebugContext(OptionValues options, CompilationIdentifier compilationId, TruffleCompilable compilable, PrintStream logStream);
public static PartialEvaluatorConfiguration createPartialEvaluatorConfiguration(String name) {
for (PartialEvaluatorConfiguration candidate : GraalServices.load(PartialEvaluatorConfiguration.class)) {
if (candidate.name().equals(name)) {
return candidate;
}
}
throw new GraalError("Cannot find partial evaluation configuration: %s", name);
}
@Override
@SuppressWarnings("try")
public final void doCompile(TruffleCompilationTask task, TruffleCompilable compilable, TruffleCompilerListener listener) {
try (TruffleCompilation compilation = openCompilation(task, compilable)) {
doCompile(compilation, listener);
}
}
/**
* General options configured for the compiler. E.g. default values set with
* -Djdk.graal.OptionKey=value.
*/
protected abstract OptionValues getGraalOptions();
/**
* Parse general options configured for the compiler, e.g. default values set withView on GitHub (pinned to a66e9ccd1d)
Solutions
- Enumerate the available configurations (iterate GraalServices.load(PartialEvaluatorConfiguration.class) and print name()) and use one of those exact names.
- For a custom configuration, add META-INF/services/jdk.graal.compiler.truffle.PartialEvaluatorConfiguration containing your implementation class so ServiceLoader finds it.
- Check for typos/case mismatch in the name string.
Example fix
// before
TruffleCompilerImpl.createPartialEvaluatorConfiguration("inlinied"); // typo
// after
for (PartialEvaluatorConfiguration c : GraalServices.load(PartialEvaluatorConfiguration.class)) {
System.out.println(c.name()); // pick the exact registered name
}
TruffleCompilerImpl.createPartialEvaluatorConfiguration("inlined"); Defensive patterns
Strategy: validation
Validate before calling
// List registered configurations and validate the name before calling
java.util.Set<String> names = GraalServices.load(PartialEvaluatorConfiguration.class).stream()
.map(PartialEvaluatorConfiguration::name)
.collect(java.util.stream.Collectors.toSet());
if (!names.contains(requestedName)) {
throw new IllegalArgumentException("Unknown config '" + requestedName + "'; available: " + names);
}
TruffleCompilerImpl.createPartialEvaluatorConfiguration(requestedName); Prevention
- Derive configuration names from the loaded services at runtime instead of hardcoding strings.
- If you ship a custom configuration, always pair the implementation with its META-INF/services entry and a unit test that ServiceLoader finds it.
When it happens
Trigger: Calling createPartialEvaluatorConfiguration with a name that no registered PartialEvaluatorConfiguration reports: typo, wrong name string, or the provider class missing its META-INF/services registration in the jar.
Common situations: Passing a configuration name from documentation that doesn't match the registered name; custom PartialEvaluatorConfiguration built without a service-provider entry; upgrading a distribution where the configuration set changed.
Related errors
- Invalid option
- Cannot downgrade from minimum required version
- Value for {} cannot be empty
- Invalid directed inlining rules file path: {path}
- {file}:{line}: {cause}
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/a7ff91022ca2f32e.
Report an issue: GitHub.