赞
踩
打包运行到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
组件初始化是吧,打包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(); } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。