oracle/graal · error · IllegalArgumentException
Unsupported replay file: ${fileName}
Error message
Unsupported replay file: ${fileName} What it means
Thrown by ReplayFileFormat.fromFileName when the given replay file name does not match any supported replay file extension (currently the Binary enum constant's extension). It is the format-detection entry point: it maps a file name to a codec, and refuses unknown formats with IllegalArgumentException.
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/ReplayCompilationSupport.java:169
return true;
}
}
return false;
}
/**
* Determines the replay file format from a file name.
*
* @throws IllegalArgumentException if {@code fileName} does not match a supported replay
* file extension
*/
public static ReplayFileFormat fromFileName(String fileName) {
for (ReplayFileFormat format : values()) {
if (format.matchesFileName(fileName)) {
return format;
}
}
throw new IllegalArgumentException("Unsupported replay file: " + fileName);
}
}
public static class Options {
// @formatter:off
@Option(help = "Format used for recorded replay compilation files.", type = OptionType.Debug)
public static final EnumOptionKey<ReplayFileFormat> ReplayFileFormat = new EnumOptionKey<>(ReplayCompilationSupport.ReplayFileFormat.Binary);
// @formatter:on
}
/**
* Checks whether the given method's compilation should be recorded according to the given
* options.
*
* @param options the option values
* @param method the method to check against the filter
* @return true if the method's compilation should be recorded
*/View on GitHub (pinned to a66e9ccd1d)
Solutions
- Check the supported extensions in the ReplayFileFormat enum and rename the file (typically to the binary replay extension) accordingly.
- Regenerate the replay file with the same GraalVM build that replays it, keeping the default extension.
- Verify the exact path string passed on the command line (typos, missing extension, wrong case).
Example fix
// before
ReplayFileFormat f = ReplayFileFormat.fromFileName("replay_dump.txt");
// after
// use a file with a supported extension, e.g. the binary replay format
ReplayFileFormat f = ReplayFileFormat.fromFileName("replay.replaybin"); Defensive patterns
Strategy: validation
Validate before calling
String name = /* replay file name */;
boolean supported = Arrays.stream(ReplayFileFormat.values())
.anyMatch(f -> f.matchesFileName(name));
if (!supported) {
// regenerate the file or fix the name/extension before configuring replay
throw new IllegalArgumentException("Not a replay file: " + name);
} Prevention
- Never rename replay files away from the extension produced by the recording build.
- Generate and consume replay files with the same GraalVM build.
When it happens
Trigger: Calling ReplayCompilationSupport.ReplayFileFormat.fromFileName(fileName) with a name that matches no ReplayFileFormat's matchesFileName — e.g. passing a .txt, .json, or misspelled extension, or a bare path with no extension when configuring -Dgraal.ReplayCompilation with a replay file.
Common situations: User renames a replay file, exports it from another tool, or hand-edits the -Dgraal.ReplayCompilationFileName/-Dgraal.ReplayMethodFile path; the default option value (-Dgraal.ReplayFileFormat) disagrees with the actual file on disk; trailing whitespace/case mismatch in the extension.
Related errors
- Invalid replay file header
- Unsupported replay file version
- Unknown registration
- Unexpected architecture name ${archName}
- LogFile substitution %s cannot be combined with any other ch
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/272e5aaa6bd38e71.
Report an issue: GitHub.