{"record":{"id":"232267dac08ee48f","repo":"apache/flink","slug":"unable-to-find-value-class","errorCode":null,"errorMessage":"Unable to find value class.","messagePattern":"Unable to find value class\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/HadoopInputFormatBase.java","lineNumber":319,"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        ReflectionUtils.setConf(mapredInputFormat, jobConf);\n\n        jobConf.getCredentials().addAll(this.credentials);\n        Credentials currentUserCreds = getCredentialsFromUGI(UserGroupInformation.getCurrentUser());\n        if (currentUserCreds != null) {\n            jobConf.getCredentials().addAll(currentUserCreds);\n        }\n    }\n}\n","sourceCodeStart":301,"sourceCodeEnd":330,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/HadoopInputFormatBase.java#L301-L330","documentation":"Thrown by HadoopInputFormatBase.readFields when Class.forName(valueClassName) fails during deserialization. The value class is the second generic type of the InputFormat pair; like the key class, it must be resolvable on the task's classpath when the format is deserialized.","triggerScenarios":"Restoring or deploying a HadoopInputFormat job where the value type class is not on the task classpath.","commonSituations":"Missing Hadoop common JAR (for standard types like Text, IntWritable); custom value class not in the submitted JAR; classpath isolation or classloader ordering issue.","solutions":["Include the JAR containing the value class in the Flink job submission classpath.","For custom value types, package them in the fat JAR or add via -C.","Inspect getCause() for the exact ClassNotFoundException message.","Verify that the value class has the same fully qualified name and package as when the format was serialized."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate value class is on the classpath before job submission\ntry {\n    Class.forName(valueClassName, false, Thread.currentThread().getContextClassLoader());\n} catch (ClassNotFoundException e) {\n    throw new IllegalArgumentException(\n        \"Value class not on classpath: \" + valueClassName + \". Add the required JAR.\", e);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Include the JAR with the value type class in the job submission.","For custom value types, package them in the fat JAR.","Verify all Writable classes are resolvable before deploying."],"tags":["hadoop-compatibility","input-format","classpath","class-loading"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}