{"record":{"id":"48c429630cb6cc25","repo":"apache/hadoop","slug":"wrong-value-class-is-not-48c429","errorCode":null,"errorMessage":"wrong value class: {} is not {}","messagePattern":"wrong value class: (.+?) is not (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/IFile.java","lineNumber":195,"sourceCode":"\n      if (compressOutput) {\n        // Return back the compressor\n        CodecPool.returnCompressor(compressor);\n        compressor = null;\n      }\n\n      out = null;\n      if(writtenRecordsCounter != null) {\n        writtenRecordsCounter.increment(numRecordsWritten);\n      }\n    }\n\n    public void append(K key, V value) throws IOException {\n      if (key.getClass() != keyClass)\n        throw new IOException(\"wrong key class: \"+ key.getClass()\n                              +\" is not \"+ keyClass);\n      if (value.getClass() != valueClass)\n        throw new IOException(\"wrong value class: \"+ value.getClass()\n                              +\" is not \"+ valueClass);\n\n      // Append the 'key'\n      keySerializer.serialize(key);\n      int keyLength = buffer.getLength();\n      if (keyLength < 0) {\n        throw new IOException(\"Negative key-length not allowed: \" + keyLength + \n                              \" for \" + key);\n      }\n\n      // Append the 'value'\n      valueSerializer.serialize(value);\n      int valueLength = buffer.getLength() - keyLength;\n      if (valueLength < 0) {\n        throw new IOException(\"Negative value-length not allowed: \" + \n                              valueLength + \" for \" + value);\n      }\n      ","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/IFile.java#L177-L213","documentation":"Error \"wrong value class: {} is not {}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/IFile.java:195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure the map output value class (mapreduce.map.output.value.class) to match the value class the IFile writer/reader was created with."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}