Hadoop java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils

commons-lang3-3.3.2.jar 学习好友推荐案例的时候,提交运行时报错找不到StringUtils

java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
[root@node01 ~]# hadoop jar MyFOF.jar com.sxt.hadoop.mr.fof.MyFOF
19/03/30 00:25:37 WARN mapreduce.JobResourceUploader: Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.
19/03/30 00:25:37 INFO input.FileInputFormat: Total input paths to process : 1
19/03/30 00:25:38 INFO mapreduce.JobSubmitter: number of splits:1
19/03/30 00:25:38 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1553914110426_0006
19/03/30 00:25:38 INFO impl.YarnClientImpl: Submitted application application_1553914110426_0006
19/03/30 00:25:38 INFO mapreduce.Job: The url to track the job: http://node03:8088/proxy/application_1553914110426_0006/
19/03/30 00:25:38 INFO mapreduce.Job: Running job: job_1553914110426_0006
19/03/30 00:25:51 INFO mapreduce.Job: Job job_1553914110426_0006 running in uber mode : false
19/03/30 00:25:51 INFO mapreduce.Job:  map 0% reduce 0%
19/03/30 00:26:01 INFO mapreduce.Job: Task Id : attempt_1553914110426_0006_m_000000_0, Status : FAILED
Error: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.sxt.hadoop.mr.fof.FMapper.map(FMapper.java:20)
    at com.sxt.hadoop.mr.fof.FMapper.map(FMapper.java:1)
    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:146)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787)
    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:1762)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)

19/03/30 00:26:14 INFO mapreduce.Job: Task Id : attempt_1553914110426_0006_m_000000_1, Status : FAILED
Error: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.sxt.hadoop.mr.fof.FMapper.map(FMapper.java:20)
    at com.sxt.hadoop.mr.fof.FMapper.map(FMapper.java:1)
    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:146)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787)
    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:1762)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)

19/03/30 00:26:24 INFO mapreduce.Job: Task Id : attempt_1553914110426_0006_m_000000_2, Status : FAILED
Error: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.sxt.hadoop.mr.fof.FMapper.map(FMapper.java:20)
    at com.sxt.hadoop.mr.fof.FMapper.map(FMapper.java:1)
    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:146)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787)
    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:1762)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)

Container killed by the ApplicationMaster.
Container killed on request. Exit code is 143
Container exited with a non-zero exit code 143

19/03/30 00:26:35 INFO mapreduce.Job:  map 100% reduce 100%
19/03/30 00:26:35 INFO mapreduce.Job: Job job_1553914110426_0006 failed with state FAILED due to: Task failed task_1553914110426_0006_m_000000
Job failed as tasks failed. failedMaps:1 failedReduces:0

19/03/30 00:26:35 INFO mapreduce.Job: Counters: 16
    Job Counters
        Failed map tasks=4
        Killed reduce tasks=1
        Launched map tasks=4
        Other local map tasks=3
        Data-local map tasks=1
        Total time spent by all maps in occupied slots (ms)=36188
        Total time spent by all reduces in occupied slots (ms)=0
        Total time spent by all map tasks (ms)=36188
        Total time spent by all reduce tasks (ms)=0
        Total vcore-milliseconds taken by all map tasks=36188
        Total vcore-milliseconds taken by all reduce tasks=0
        Total megabyte-milliseconds taken by all map tasks=37056512
        Total megabyte-milliseconds taken by all reduce tasks=0
    Map-Reduce Framework
        CPU time spent (ms)=0
        Physical memory (bytes) snapshot=0
        Virtual memory (bytes) snapshot=0

编译时没问题,提交运行错误,说明在运行环境中找不到StringUtils。

解决办法:

从/opt/sxt/hadoop-2.7.7/share/hadoop/tools/lib目录下拷贝commons-lang3-3.3.2.jar到opt/sxt/hadoop-2.7.7/share/hadoop/common/lib目录下,然后将commons-lang3-3.3.2.jar分别拷贝到各DataNode[root@node01 lib]# scp commons-lang3-3.3.2.jar node02:`pwd`

commons-lang3-3.3.2.jar                                                                    100%  403KB   8.1MB/s   00:00
[root@node01 lib]# scp commons-lang3-3.3.2.jar node03:`pwd`
commons-lang3-3.3.2.jar                                          100%  403KB   7.6MB/s   00:00
[root@node01 lib]# scp commons-lang3-3.3.2.jar node04:`pwd`
commons-lang3-3.3.2.jar                                                     100%  403KB   7.0MB/s   00:00 

原文地址:https://www.cnblogs.com/144823836yj/p/10626503.html

时间: 2024-11-28 23:33:38

Hadoop java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils的相关文章

Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils

1.错误描述 2014-7-10 23:12:23 org.apache.catalina.core.StandardContext filterStart 严重: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils at com.opensymphony.xwork2.config.providers.XmlConfigurationProv

spring异常记录-----java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

今天在练习怎样SSH中进行单元測试的时候出现下列异常: SEVERE: Exception starting filter Struts2 java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:211

java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

1.java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils 缺少类 2. There is no Action mapped for namespace [/] and action name [indexjsp] associated with context path [/test1Struts2]. - [unknown location]莫名其妙就好了,不知错在哪了,不过我把jsp文件删了,重新建的,有谁知

java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource解决方法

java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource解决方法 只需把这三个commons-pool.jar.commons-dbcp-1.2.2.jar和commons-collections-3.2.jar包加入到lib里即可解决.这三个包在你本地的tomcat下的lib里,直接buildpath导入就行了,不过有时导包不一定好使,是因为工程lib下的包跟tomcat下的包重复了,导致异常错误如: o

java.lang.ClassNotFoundException: org.apache.commons.dbutils.QueryRunner

七月 28, 2017 11:06:33 下午 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() for servlet [com.itheima.transfer.web.TransferServlet] in context with path [/WEB19] threw exception [Servlet execution threw an exception] with root ca

Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils

1.错误描述 警告: Could not create JarEntryRevision for [jar:file:/D:/MyEclipse/apache-tomcat-7.0.53/webapps/FirstSSH/WEB-INF/lib/struts2-core-2.3.16.3.jar]! java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils at com.opensymphony.xwork2.util.fs.

java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException

遇到这种问题是因为jar包引入不全,完整的应该包含: commons-beanutils-1.8.3.jar commons-lang-2.5.jar ezmorph-1.0.6.jar json-lib-2.3-jdk15.jar 但是又出现如下问题: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory 导入commons-logging-1.1.1.jar 又出现如下问题: java.lang.NoC

ssh整合启动tomcat报java.lang.ClassNotFoundException: org.apache.commons.lang.xwork.StringUtils

今天搭建了一个ssh项目环境,整合后,访问项目首页,登录不进去,控制台报错,后来调试代码后,在获取数据库数据后,返回到action时,又进入了action导致死循环,其实这里是两个问题,控制台报错如下: 2015-4-27 20:57:56 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() for servlet default threw exceptionjava.lang.ClassNotFo

Tomcat中使用commons-io-2.5发生的错误java.lang.ClassNotFoundException: org.apache.commons.io.IOUtils

关键词:IntelliJ IDEA.Tomcat.commons-io-2.5.jar.java.lang.ClassNotFoundException: org.apache.commons.io.IOUtils 1.错误提示信息 图1 运行登录时错误信息 //Tomcat Localhost Log信息 org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [Servlet] in