当前位置:网站首页>运行mapreduce任务缺失setJarByClass()报错找不到类
运行mapreduce任务缺失setJarByClass()报错找不到类
2022-06-10 15:29:00 【QYHuiiQ】
报错信息中提示说是类找不到,但是直观来看,我的自定义Map类是在的,但是还是报错:
[[email protected] word_count_jar]# hadoop jar test_word_count-1.0-SNAPSHOT.jar wyh.test.mapreduce.WordCountMain
22/05/27 07:34:08 INFO client.RMProxy: Connecting to ResourceManager at hadoop01/192.168.126.132:8032
22/05/27 07:34:09 WARN mapreduce.JobResourceUploader: No job jar file set. User classes may not be found. See Job or Job#setJar(String).
22/05/27 07:34:09 INFO input.FileInputFormat: Total input paths to process : 1
22/05/27 07:34:10 INFO mapreduce.JobSubmitter: number of splits:1
22/05/27 07:34:10 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1653650542989_0001
22/05/27 07:34:10 INFO mapred.YARNRunner: Job jar is not present. Not adding any jar to the list of resources.
22/05/27 07:34:11 INFO impl.YarnClientImpl: Submitted application application_1653650542989_0001
22/05/27 07:34:11 INFO mapreduce.Job: The url to track the job: http://hadoop01:8088/proxy/application_1653650542989_0001/
22/05/27 07:34:11 INFO mapreduce.Job: Running job: job_1653650542989_0001
22/05/27 07:34:24 INFO mapreduce.Job: Job job_1653650542989_0001 running in uber mode : false
22/05/27 07:34:24 INFO mapreduce.Job: map 0% reduce 0%
22/05/27 07:34:30 INFO mapreduce.Job: Task Id : attempt_1653650542989_0001_m_000000_0, Status : FAILED
Error: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class wyh.test.mapreduce.WordCountMapper not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2267)
at org.apache.hadoop.mapreduce.task.JobContextImpl.getMapperClass(JobContextImpl.java:187)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:747)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
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:1754)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.ClassNotFoundException: Class wyh.test.mapreduce.WordCountMapper not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2171)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2265)
... 8 more
原因在于我的hadoop是集群环境,而在job主类中我没有设置要运行的类,添加如下配置即可:
job.setJarByClass(WordCountMain.class);
再次运行,报错消失。
边栏推荐
- docket命令
- 自动化运维必备的工具-Shell脚本介绍
- 云图说|每个成功的业务系统都离不开APIG的保驾护航
- Click to unlock "keyword" of guanghetong 5g module
- VINS理论与代码详解4——初始化
- 4. Meet panuon again UI. Title bar of silver form
- 姿态估计之2D人体姿态估计 - SimDR: Is 2D Heatmap Representation Even Necessary for Human Pose Estimation?
- Tensorflow actual combat Google deep learning framework version 2 learning summary tensorflow installation
- 探索数据可视化开发平台FlyFish开源背后的秘密!
- 姿态估计之2D人体姿态估计 - (OpenPose) Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields
猜你喜欢

Digital management medium + low code, jnpf opens a new engine for enterprise digital transformation

Sorting and paging

Methods commonly used in uniapp (part) - timestamp problem and rich text parsing image problem

HKU and NVIDIA | factuality enhanced language models for open ended text generation

How does CRM help enterprises and salespeople?

顺应医改,积极布局——集采背景下的高值医用耗材发展洞察2022

数字化管理中台+低代码,JNPF开启企业数字化转型的新引擎

姿态估计之2D人体姿态估计 - Associative Embedding: End-to-End Learning for Joint Detection and Grouping

Save a window with a specific size, resolution, or background color
![姿态估计之2D人体姿态估计 - Human Pose Regression with Residual Log-likelihood Estimation(RLE)[仅链接]](/img/c7/9c25da07236ef0bd241b6023e82306.gif)
姿态估计之2D人体姿态估计 - Human Pose Regression with Residual Log-likelihood Estimation(RLE)[仅链接]
随机推荐
How does CRM help enterprises and salespeople?
作用域和闭包
How to write a global notice component?
Kubernetes 1.24: preventing unauthorized volume mode switching
RSA a little bit of thought
百度开源ICE-BA安装运行总结
Apple style Chinese: it seems to express the meaning clearly, and the Apple style propaganda copy that you don't fully understand
姿态估计之2D人体姿态估计 - SimDR: Is 2D Heatmap Representation Even Necessary for Human Pose Estimation?
Yuntu says that every successful business system cannot be separated from apig
Vins theory and code explanation 0 -- theoretical basis in vernacular
Fast detection of short text repetition rate
智能电网终极Buff | 广和通模组贯穿“发、输、变、配、用”全环节
uniapp中常用到的方法(部分) - 时间戳问题及富文本解析图片问题
视觉SLAM常见的QR分解SVD分解等矩阵分解方式求解满秩和亏秩最小二乘问题(最全的方法分析总结)
产品设计软件Figma用不了,国内有哪些相似功能的软件
ORB_SLAM2视觉惯性紧耦合定位技术路线与代码详解1——IMU流型预积分
Net core Tianma XingKong series - Interface Implementation for dependency injection and mutual conversion of database tables and C entity classes
Explain the opencv function filter2d() in detail and remind you that the operation it does is not convolution but correlation operation
Click to unlock "keyword" of guanghetong 5g module
【对象】。