{"record":{"id":"90fdad60adfdf6a7","repo":"apache/flink","slug":"unable-to-find-value-class-90fdad","errorCode":null,"errorMessage":"Unable to find value class.","messagePattern":"Unable to find value class\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java","lineNumber":343,"sourceCode":"        try {\n            this.keyClass =\n                    (Class<K>)\n                            Class.forName(\n                                    keyClassName,\n                                    true,\n                                    Thread.currentThread().getContextClassLoader());\n        } catch (Exception e) {\n            throw new RuntimeException(\"Unable to find key class.\", e);\n        }\n        try {\n            this.valueClass =\n                    (Class<V>)\n                            Class.forName(\n                                    valueClassName,\n                                    true,\n                                    Thread.currentThread().getContextClassLoader());\n        } catch (Exception e) {\n            throw new RuntimeException(\"Unable to find value class.\", e);\n        }\n    }\n}\n","sourceCodeStart":325,"sourceCodeEnd":347,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java#L325-L347","documentation":"Thrown during Java deserialization of HadoopInputFormatBase when readObject() cannot load the value class by name via Class.forName(valueClassName, true, contextClassLoader). Symmetric to the key-class failure: the value class name was serialized from the client and must be resolvable on every TaskManager.","triggerScenarios":"Triggered on the TaskManager when Class.forName(valueClassName, true, contextClassLoader) fails during readObject() — e.g. the value class is missing from the shipped jar, was shaded/renamed, or the user-code classloader cannot resolve it.","commonSituations":"Custom Writable value type not in the submitted jar; value class relocated by shading; generated class (Avro/Protobuf/Thrift) omitted from the fat jar; dependency version mismatch where the value class package changed between build and runtime.","solutions":["Include the value class (and its transitive dependencies) in the user-code jar submitted with the job.","If shading, ensure the value class's runtime name matches the serialized name.","Rebuild and resubmit the fat jar so the TaskManager classloader can resolve the value type.","Confirm the value class is public and loadable by the user-code classloader."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify the value class is resolvable on the runtime classpath before submitting\nString valueName = valueClass.getName();\ntry {\n    Class.forName(valueName, true, Thread.currentThread().getContextClassLoader());\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\"Value class \" + valueName\n        + \" is not on the runtime classpath; ship it in the user-code jar\", e);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Include value classes (and transitive deps) in the submitted user-code jar.","Keep shading consistent so runtime names match serialized names.","Verify generated value classes (Avro/Protobuf) are packaged.","Match dependency versions across build and cluster."],"tags":["hadoop","mapreduce","serialization","classloader","value-class"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}