{"record":{"id":"90303c08b937e792","repo":"apache/hadoop","slug":"invalid-output-collector-class-clazzname-does","errorCode":null,"errorMessage":"Invalid output collector class: {clazzName} (does not implement MapOutputCollector)","messagePattern":"Invalid output collector class: (.+?) \\(does not implement MapOutputCollector\\)","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/MapTask.java","lineNumber":401,"sourceCode":"   inFile.close();\n   return split;\n }\n  \n  @SuppressWarnings(\"unchecked\")\n  private <KEY, VALUE> MapOutputCollector<KEY, VALUE>\n          createSortingCollector(JobConf job, TaskReporter reporter)\n    throws IOException, ClassNotFoundException {\n    MapOutputCollector.Context context =\n      new MapOutputCollector.Context(this, job, reporter);\n\n    Class<?>[] collectorClasses = job.getClasses(\n      JobContext.MAP_OUTPUT_COLLECTOR_CLASS_ATTR, MapOutputBuffer.class);\n    int remainingCollectors = collectorClasses.length;\n    Exception lastException = null;\n    for (Class clazz : collectorClasses) {\n      try {\n        if (!MapOutputCollector.class.isAssignableFrom(clazz)) {\n          throw new IOException(\"Invalid output collector class: \" + clazz.getName() +\n            \" (does not implement MapOutputCollector)\");\n        }\n        Class<? extends MapOutputCollector> subclazz =\n          clazz.asSubclass(MapOutputCollector.class);\n        LOG.debug(\"Trying map output collector class: \" + subclazz.getName());\n        MapOutputCollector<KEY, VALUE> collector =\n          ReflectionUtils.newInstance(subclazz, job);\n        collector.init(context);\n        LOG.info(\"Map output collector class = \" + collector.getClass().getName());\n        return collector;\n      } catch (Exception e) {\n        String msg = \"Unable to initialize MapOutputCollector \" + clazz.getName();\n        if (--remainingCollectors > 0) {\n          msg += \" (\" + remainingCollectors + \" more collector(s) to try)\";\n        }\n        lastException = e;\n        LOG.warn(msg, e);\n      }","sourceCodeStart":383,"sourceCodeEnd":419,"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/MapTask.java#L383-L419","documentation":"Fires in MapTask.createSortingCollector while iterating the configured map output collector classes (mapreduce.job.map.output.collector.class.attr, defaulting to MapOutputBuffer): a candidate class is not a subclass of MapOutputCollector, so asSubclass fails or the check rejects it. The collector class name is reported and the loop moves on to remaining collector candidates, only failing outright if none work.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/MapTask.java:401 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set mapreduce.job.map.output.collector.class to a class that implements MapOutputCollector, such as the default MapOutputBuffer."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}