oracle/graal · error · FormatVersionException
Unsupported serialized continuation version: %s\nCurrent sup
Error message
Unsupported serialized continuation version: %s\nCurrent supported version: %s
What it means
Thrown as FormatVersionException by FrameRecordSerializer.forOut when the version passed to create a writer is not FrameRecordSerializerV2.FORMAT_VERSION. ContinuationImpl calls this on the write path with its own FORMAT_VERSION; the exception means the top-level continuation format version and the frame-record writer version have diverged — an internal/library-build inconsistency, since both constants ship in the same JAR.
Source
Thrown at espresso/src/org.graalvm.continuations/src/org/graalvm/continuations/FrameRecordSerializer.java:72
final ObjectOutput out;
final ObjectInput in;
ClassLoader loader;
protected FrameRecordSerializer(ObjectOutput out) {
this.out = out;
this.in = null;
}
protected FrameRecordSerializer(ObjectInput in) {
this.out = null;
this.in = in;
}
public static FrameRecordSerializer forOut(int version, ObjectOutput out) throws FormatVersionException {
if (version == FrameRecordSerializerV2.FORMAT_VERSION) {
return new FrameRecordSerializerV2(out);
}
throw new FormatVersionException(version, ContinuationImpl.FORMAT_VERSION);
}
public static FrameRecordSerializer forIn(int version, ObjectInput in) throws FormatVersionException {
if (version == FrameRecordSerializerV2.FORMAT_VERSION) {
return new FrameRecordSerializerV2(in);
}
throw new FormatVersionException(version, ContinuationImpl.FORMAT_VERSION);
}
public final FrameRecordSerializer withLoader(ClassLoader classLoader) {
this.loader = classLoader;
return this;
}
public abstract void writeRecord(ContinuationImpl.FrameRecord frameRecord) throws IOException;
public abstract ContinuationImpl.FrameRecord readRecord() throws IOException, ClassNotFoundException;
}View on GitHub (pinned to a66e9ccd1d)
Solutions
- Align all copies of org.graalvm.continuations to one version: remove shaded duplicates and depend on the version shipped with your GraalVM.
- Run dependencyInsight/classpath diagnostics (mvn dependency:tree, gradle dependencies) to find who pulls in the stale org.graalvm.continuations artifact.
- After aligning, re-serialize continuations — payloads written by the mismatched build are also suspect.
- If you build GraalVM from source, do a clean mx build of the espresso suite so ContinuationImpl and FrameRecordSerializerV2 come from the same tree.
Example fix
// before
// fat jar shades org.graalvm.continuations:1.0 while VM ships 24.x
// -> forOut throws FormatVersionException at write time
// after
// exclude the shaded copy so only the VM-provided library is used
// build.gradle:
dependencies { implementation('com.example:fatlib:1.0') { exclude group: 'org.graalvm.continuations' } } Defensive patterns
Strategy: validation
Validate before calling
// fail fast at startup on library mismatch
Class<?> a = Class.forName("org.graalvm.continuations.ContinuationImpl");
Class<?> b = Class.forName("org.graalvm.continuations.FrameRecordSerializerV2");
if (!a.getProtectionDomain().getCodeSource().equals(b.getProtectionDomain().getCodeSource())) {
throw new IllegalStateException("Mixed org.graalvm.continuations copies on classpath");
} Prevention
- Keep exactly one copy of org.graalvm.continuations on the classpath/module path.
- Exclude continuation classes when shading dependencies into fat JARs.
- When building GraalVM from source, clean-build the whole espresso suite together.
When it happens
Trigger: ContinuationImpl.writeExternalImpl handing its FORMAT_VERSION to forOut when the linked FrameRecordSerializerV2 no longer accepts it; in practice this happens only when continuation classes from different builds are mixed on the classpath or module path.
Common situations: A workspace or application that bundles one version of org.graalvm.continuations while the VM supplies another; partial upgrades of GraalVM components (e.g. upgrading espresso but not the continuations library); shaded/fat JARs embedding stale copies of the library.
Related errors
- Unsupported serialized continuation version: %s\nCurrent sup
- %s is not an enum type
- Unrecognized version
- Missing expected guest type conversion interface in polyglot
- You can't resume a continuation while it is being serialized
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/b83f92a4a0e7d399.
Report an issue: GitHub.