求各位大佬看看我这是什么问题

package com.position.clean;

import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;

/**
 * @author zyb
 * @date 2021/6/15 - 17:28
 */
public class CleanJob {
    public static String deleteString(String str, char delchar) {
        StringBuffer stringBuffer = new StringBuffer("");
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) != delchar) {
                stringBuffer.append(str.charAt(i));
            }
        }
        return stringBuffer.toString();
    }
    public static String mergeString(String position, JSONArray company)throws JSONException{
        String result = "";
        if (company.length() != 0) {
            for (int i = 0; i < company.length(); i++) {
                result = result + company.get(i) + "-";
            }
        }
        if (position != "") {
            String[] positionList = position.split("|;|, |、|,|; |/");
            for (int i = 0; i < positionList.length; i++) {
                result = result + positionList[i].replaceAll("[\\pP\\p{Punct}]","")+"-";
            }
        }
        return result.substring(0,result.length()-1);
    }
    public static String killResult(JSONArray killData) throws JSONException{
        String result = "";
        if (killData.length() != 0) {
            for (int i = 0; i < killData.length(); i++) {
                result = result + killData.get(i) + "-";
            }
            result = result.substring(0, result.length()-1);
        }
        return result;
    }
    public static String resultTOString(JSONArray jobdata)throws JSONException{
        String jobResultData = "";
        for (int i = 0; i < jobdata.length(); i++ ) {
            String everyData=jobdata.get(i).toString();
            JSONObject everyDataJson = new JSONObject(everyData);
            String city = everyDataJson.getString("city");
            String salary = everyDataJson.getString("salary");
            String positionAdvantage = everyDataJson.getString("positionAdvantage");
            JSONArray skillLables = everyDataJson.getJSONArray("skillLables");
            JSONArray companyLabelList = everyDataJson.getJSONArray("companyLabelList");
            String salaryNew = deleteString(salary,'k');
            String welfare = mergeString(positionAdvantage,companyLabelList);
            String kill = killResult(skillLables);
            if (i == jobdata.length()-1) {
                jobResultData = jobResultData + city + "," +salaryNew + "," + welfare + "," + kill;
            }else {
                jobResultData = jobResultData + city + "," +salaryNew + "," + welfare + "," + kill + "/n";
            }
        }
        return jobResultData;
    }
}
package com.position.clean;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;

import java.io.IOException;

/**
 * @author zyb
 * @date 2021/6/15 - 17:28
 */
public class CleanMapper extends Mapper<LongWritable, Text, Text, NullWritable> {
    @Override
    protected void map(LongWritable key, Text value, Context context)
            throws IOException, InterruptedException {
        String jobResultData = "";
        String reptileData = value.toString();
        String jobData = reptileData.substring(
                reptileData.indexOf("=",reptileData.indexOf("=")+1)+1,
                reptileData.length()-1);
        try {
            JSONObject contentJson = new JSONObject(jobData);
            String contentData = contentJson.getString("content");
            JSONObject positionResultJson = new JSONObject(contentData);
            String positionResultData =
                    positionResultJson.getString("positionResult");
            JSONObject resultJson = new JSONObject(positionResultData);
            JSONArray resultData = resultJson.getJSONArray("result");
            jobResultData = CleanJob.resultTOString(resultData);
            context.write(new Text(jobResultData), NullWritable.get());
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
}
package com.position.clean;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.log4j.BasicConfigurator;

import java.io.IOException;

/**
 * @author zyb
 * @date 2021/6/15 - 17:28
 */
public class CleanMain {
    public static void main(String[] args) throws IOException,
            ClassNotFoundException, InterruptedException {
        BasicConfigurator.configure();
        Configuration conf = new Configuration();
        Job job = new Job(conf, "job");
        job.setJarByClass(CleanMain.class);
        job.setMapperClass(CleanMapper.class);
        job.setOutputKeyClass(Text.class);
        job.setOutputValueClass(NullWritable.class);
        FileInputFormat.addInputPath(job, new Path("hdfs://centos01:9000//JobData//20210615"));
        FileOutputFormat.setOutputPath(job, new Path("E:/IDEA/out1"));
        //FileInputFormat.setInputPaths(job,new Path(args[0]));
        //FileOutputFormat.setOutputPath(job,new Path(args[1]));
        System.exit(job.waitForCompletion(true) ? 0 : 1);
    }
}

在IDEA上  跑不起来  本地测试不生成文件

不会报错但是会出现这种情况,求大佬们指点谢谢了

首先学会查询日志信息,快速定位关键性的内容。

在代码中多加点打印日志,方便跟踪问题,debug调试运行也可以,看看具体卡在哪一步。运行不起来跟下你截图中的日志。

如有帮助,望采纳。点击我回答右上角【采纳】按钮。

 

您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps: 问答会员年卡【8折】购 ,限时加赠IT实体书,即可 享受50次 有问必答服务,了解详情>>>https://t.csdnimg.cn/RW5m