{"record":{"id":"92afbe82e09c8b16","repo":"oracle/graal","slug":"no-serializer-registered-for-the-given-tag-tag","errorCode":null,"errorMessage":"No serializer registered for the given tag ${tag}","messagePattern":"No serializer registered for the given tag (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java","lineNumber":1917,"sourceCode":"                if (serializer == null) {\n                    throw new IllegalArgumentException(\"No serializer for \" + instance.getClass() + \": \" + instance);\n                }\n            }\n            try (JsonBuilder.ObjectBuilder builder = valueBuilder.object()) {\n                builder.append(\"tag\", serializer.tag());\n                serializer.serialize(instance, builder, this);\n            }\n        }\n\n        @Override\n        public void serialize(Object instance, JsonBuilder.ValueBuilder valueBuilder, String tag) throws IOException {\n            if (instance == null) {\n                valueBuilder.value(null);\n                return;\n            }\n            ObjectSerializer serializer = tagSerializers.get(tag);\n            if (serializer == null) {\n                throw new IllegalArgumentException(\"No serializer registered for the given tag \" + tag);\n            }\n            try (JsonBuilder.ObjectBuilder builder = valueBuilder.object()) {\n                serializer.serialize(instance, builder, this);\n            }\n        }\n    };\n\n    /**\n     * Writes a recorded compilation unit in JSON replay format.\n     *\n     * @param compilationUnit the compilation unit to encode\n     * @param writer the destination writer\n     * @throws IOException if encoding fails\n     */\n    public void dump(RecordedCompilationUnit compilationUnit, JsonWriter writer) throws IOException {\n        recursiveSerializer.serialize(compilationUnit, writer.valueBuilder(), RecordedCompilationUnitSerializer.TAG);\n    }\n","sourceCodeStart":1899,"sourceCodeEnd":1935,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java#L1899-L1935","documentation":"RecursiveSerializer.serialize(Object, ValueBuilder, String tag) is the tag-directed variant used for top-level entries such as the compilation unit: it looks up tagSerializers by the caller-supplied tag. IllegalArgumentException('No serializer registered for the given tag ...') means the codec instance has no serializer registered under that tag string.","triggerScenarios":"Calling serialize(instance, valueBuilder, tag) with a tag that was never registered — e.g. RecordedCompilationUnitSerializer.TAG on a codec built without that serializer, or a typo'd/custom tag.","commonSituations":"Constructing a reduced JsonReplayCodec (subset of serializers) but serializing the full compilation unit; version drift renaming tags; custom code adding new top-level entry types without registering them.","solutions":["Verify the tag string matches a registered serializer's tag() return value exactly","Register the missing serializer in the codec's tagSerializers map before serializing","Use the codec's public write entry point rather than calling the internal tagged serialize directly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before the tagged serialize call\nif (!codec.hasSerializerForTag(tag)) { // or expose tagSerializers\n    throw new IllegalArgumentException(\"No serializer for tag \" + tag + \"; register one first\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer the codec's public write() entry point over calling the internal tagged serializer directly","When adding a top-level entry type, register its serializer before any write"],"tags":["graalvm","replay","serialization","tag"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}