{"record":{"id":"45533ff82cae5004","repo":"apache/flink","slug":"this-object-is-a-dummy-typeserializer","errorCode":null,"errorMessage":"This object is a dummy TypeSerializer.","messagePattern":"This object is a dummy TypeSerializer\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"critical","filePath":"flink-core/src/main/java/org/apache/flink/api/common/typeutils/UnloadableDummyTypeSerializer.java","lineNumber":63,"sourceCode":"    }\n\n    public UnloadableDummyTypeSerializer(byte[] actualBytes, @Nullable Throwable originalError) {\n        this.actualBytes = Preconditions.checkNotNull(actualBytes);\n        this.originalError = originalError;\n    }\n\n    public byte[] getActualBytes() {\n        return actualBytes;\n    }\n\n    @Nullable\n    public Throwable getOriginalError() {\n        return originalError;\n    }\n\n    @Override\n    public boolean isImmutableType() {\n        throw new UnsupportedOperationException(\"This object is a dummy TypeSerializer.\");\n    }\n\n    @Override\n    public TypeSerializer<T> duplicate() {\n        throw new UnsupportedOperationException(\"This object is a dummy TypeSerializer.\");\n    }\n\n    @Override\n    public T createInstance() {\n        throw new UnsupportedOperationException(\"This object is a dummy TypeSerializer.\");\n    }\n\n    @Override\n    public T copy(T from) {\n        throw new UnsupportedOperationException(\"This object is a dummy TypeSerializer.\");\n    }\n\n    @Override","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/common/typeutils/UnloadableDummyTypeSerializer.java#L45-L81","documentation":"Thrown by UnloadableDummyTypeSerializer.isImmutableType() when the runtime attempts to query mutability on a dummy serializer. An UnloadableDummyTypeSerializer is created when a serializer snapshot cannot restore its real serializer because the serializer class is missing from the classpath (ClassNotFoundException) or has an incompatible serial version (InvalidClassException). The dummy preserves the raw serialized bytes so they are not lost on re-checkpoint, but it cannot perform any real serializer operation. isImmutableType is typically called by the state backend to decide copy-on-read behavior.","triggerScenarios":"Restoring a checkpoint/savepoint whose state serializer class is not on the job's classpath at restore time. Common when the user JAR with the serializer/POJO class is not submitted, was renamed, moved packages, or its serialVersionUID changed. Any state-backend operation that calls isImmutableType on the dummy then throws.","commonSituations":"Submitting a job without the user-code JAR that contains the POJO or custom serializer. Refactoring a POJO to a different package between the checkpoint and the restore. Changing a custom serializer's class without maintaining serialVersionUID or a TypeSerializerSnapshot migration path. Upgrading a connector or UDF library whose internal serializer class changed.","solutions":["Ensure the JAR containing the serializer class and the POJO class is on the classpath at restore time (include it in the job submission).","If the class was moved/renamed, restore from the old class location first, take a savepoint, then migrate.","Maintain serialVersionUID on custom serializers and implement a proper TypeSerializerSnapshot for migration.","If the class is genuinely gone, write a compatible replacement serializer with a snapshot that handles the old format."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Before restore, verify the serializer/type class is loadable on the classpath\ntry {\n    Class.forName(\"com.example.MyStateType\");\n    Class.forName(\"com.example.MyTypeSerializer\");\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\n        \"Missing class on classpath — include the user-code JAR before restore\", e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    env.execute(\"job\");\n} catch (Exception e) {\n    if (e.getCause() instanceof UnsupportedOperationException\n            && e.getMessage().contains(\"dummy TypeSerializer\")) {\n        log.error(\"Serializer class missing at restore. Add the JAR and restart.\");\n    }\n    throw e;\n}","preventionTips":["Always submit the user-code JAR containing POJO/custom-serializer classes with the job.","Keep serialVersionUID stable on custom serializers and implement TypeSerializerSnapshot migration.","After refactoring a class's package, restore from the old layout first and take a savepoint before migrating.","Log the originalError from UnloadableDummyTypeSerializer.getOriginalError() to identify the missing class."],"tags":["serialization","state","checkpoint","savepoint","classpath","class-not-found","unsupported-operation"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}