oracle/graal · error · IllegalArgumentException

No deserializer registered for tag ${tag}

Error message

No deserializer registered for tag ${tag}

What it means

The untagged deserialization path (error 155's dispatch) reads the 'tag' from the map, then looks it up in tagSerializers. IllegalArgumentException('No deserializer registered for tag ...') means the tag exists in the file but this codec instance has no serializer registered under it.

Source

Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java:1949

     */
    public void dump(RecordedCompilationUnit compilationUnit, JsonWriter writer) throws IOException {
        recursiveSerializer.serialize(compilationUnit, writer.valueBuilder(), RecordedCompilationUnitSerializer.TAG);
    }

    private RecursiveDeserializer createRecursiveDeserializer() {
        return new RecursiveDeserializer() {
            @Override
            @SuppressWarnings("unchecked")
            public Object deserialize(Object json, CompilationProxies.ProxyFactory proxyFactory) throws DeserializationException {
                if (json instanceof EconomicMap<?, ?>) {
                    EconomicMap<String, Object> map = (EconomicMap<String, Object>) json;
                    String tag = (String) map.get("tag");
                    if (tag == null) {
                        throw new IllegalArgumentException("The replay map does not contain a tag: " + map);
                    }
                    ObjectSerializer deserializer = tagSerializers.get(tag);
                    if (deserializer == null) {
                        throw new IllegalArgumentException("No deserializer registered for tag " + tag);
                    }
                    return deserializer.deserialize(map, this, proxyFactory);
                } else {
                    return json;
                }
            }

            @Override
            @SuppressWarnings("unchecked")
            public Object deserialize(Object json, CompilationProxies.ProxyFactory proxyFactory, String tag) throws DeserializationException {
                if (json instanceof EconomicMap<?, ?>) {
                    EconomicMap<String, Object> map = (EconomicMap<String, Object>) json;
                    ObjectSerializer deserializer = tagSerializers.get(tag);
                    if (deserializer == null) {
                        throw new IllegalArgumentException("No deserializer registered for tag " + tag);
                    }
                    return deserializer.deserialize(map, this, proxyFactory);
                } else {

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Upgrade the replaying GraalVM to at least the version that wrote the file
  2. Register a deserializer for the tag in tagSerializers before replay
  3. Re-record the file with the same build that will replay it
Defensive patterns

Strategy: validation

Validate before calling

Set<String> knownTags = codec.registeredTags();
String tag = (String) map.get("tag");
if (!knownTags.contains(tag)) {
    throw new IllegalArgumentException("Replay file uses unknown tag '" + tag + "'; was it written by a newer GraalVM?");
}

Prevention

When it happens

Trigger: Replaying a file containing a tag string this codec version does not know — e.g. a newer format tag ('constantV2') read by an older build, or a tag from a fork's custom serializer.

Common situations: Version skew (replay file newer than the reading GraalVM); custom extensions recorded but not registered on the replay side; typo'd tags in edited files.

Related errors


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