亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

運行主類報錯

運行hadoop主類的時候,一直出現這個錯,clean了項目也沒用:

錯誤: 找不到或無法加載主類 Step1.CF_MR1,能幫忙看下什么原因么:

package Step1;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider.Text;

public class CF_MR1 {
?? ?
?? ?private static String inPath="/ItemCF/step1_input/ActionList.txt";
?? ?
?? ?private static String outPath="/ItemCF/step1_output";
?? ?
?? ?private static String hdfs="hdfs://master:9000";
?? ?
?? ?public int run(){
?? ?try {
?? ??? ?
?? ??? ?Configuration conf=new Configuration();
?? ??? ?
?? ??? ?conf.set("fs.defaultFS", hdfs);
?? ??? ?
?? ??? ?Job job=Job.getInstance(conf,"step1");
?? ??? ?
?? ??? ?job.setJarByClass(CF_MR1.class);
?? ??? ?job.setMapperClass(Mapper1.class);
?? ??? ?job.setReducerClass(Reducer1.class);
?? ??? ?
?? ??? ?job.setMapOutputKeyClass(Text.class);
?? ??? ?job.setMapOutputValueClass(Text.class);
?? ??? ?
?? ??? ?job.setOutputKeyClass(Text.class);
?? ??? ?job.setOutputValueClass(Text.class);
?? ??? ?
?? ??? ?FileSystem fs=FileSystem.get(conf);
?? ??? ?Path inputPath=new Path(inPath);
?? ??? ?if(fs.exists(inputPath)){
?? ??? ??? ?org.apache.hadoop.mapreduce.lib.input.FileInputFormat.addInputPath(job, inputPath);
?? ??? ?}
?? ??? ?
?? ??? ?Path outputPath=new Path(outPath);
?? ??? ?fs.delete(outputPath, true);
?? ??? ?FileOutputFormat.setOutputPath(job, outputPath);
?? ??? ?
?? ??? ?try {
?? ??? ??? ?return job.waitForCompletion(true)?1:-1;
?? ??? ?} catch (ClassNotFoundException e) {
?? ??? ??? ?e.printStackTrace();
?? ??? ?} catch (InterruptedException e) {
?? ??? ??? ?e.printStackTrace();
?? ??? ?}
?? ??? ?
?? ??? ?} catch (IOException e) {
?? ??? ??? ?// TODO Auto-generated catch block
?? ??? ??? ?e.printStackTrace();
?? ??? ?}
?? ??? ?
?? ??? ?return -1;
?? ?}
?? ?
?? ?
?? ?public static void main(String[] args) {
?? ??? ?int result=-1;
?? ??? ?CF_MR1 mr1=new CF_MR1();
?? ??? ?result=mr1.run();
?? ??? ?if(result==1){
?? ??? ??? ?System.out.println("step1運行成功");
?? ??? ??? ?
?? ??? ?}else if(result==-1){
?? ??? ??? ?System.out.println("step1運行失敗");
?? ??? ?}
?? ??? ?
?? ?}

}


正在回答

1 回答

具體一點吧這個報的什么呀

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

運行主類報錯

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號