当前位置:   article > 正文

java.io.IOException: Initialization of all the collectors failed. Error in last collector was:java.

initialization of all the collectors failed. error in last collector was:jav

打包运行到mapre报错

java.io.IOException: Initialization of all the collectors failed. Error in last collector was:java.lang.NullPointerException
	at org.apache.hadoop.mapred.MapTask.createSortingCollector(MapTask.java:423)
	at org.apache.hadoop.mapred.MapTask.access$100(MapTask.java:82)
	at org.apache.hadoop.mapred.MapTask$NewOutputCollector.<init>(MapTask.java:710)
	at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:782)
	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:347)
	at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:174)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:422)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1729)
	at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:168)
Caused by: java.lang.NullPointerException
	at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:1025)
	at org.apache.hadoop.mapred.MapTask.createSortingCollector(MapTask.java:408)
	... 9 more
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

组件初始化是吧,打包jar上mapredure运行的时候报错了,后来查看,我的实体类需要实现 Writable 结果

package test.hbase.test.bean;

import lombok.Data;
import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

/**
 * @Author: wumingkai
 * @Description:
 * @Date:Create:in 2020/12/13 15:30
 * @Modified By:
 */
@Data
public class AdressBean implements Writable {

    private String city;

    private String address;

    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeUTF(city);
        dataOutput.writeUTF(address);
    }

    @Override
    public void readFields(DataInput dataInput) throws IOException {
        this.city = dataInput.readUTF() ;
        this.address = dataInput.readUTF();
    }

}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/504912
推荐阅读
相关标签
  

闽ICP备14008679号