" java.lang.ClassNotFoundException:org.apache.http.impl.client.HttpClientBuilder"在Hadoop中运行程序时

时间:2014-07-28 15:26:28

标签: hadoop mapreduce httpclient apache-httpclient-4.x

我编写了一个代码来扩展缩短的网址。该代码作为一个独立的程序工作正常。但是当我把它放在Hadoop中我在Map函数中提取url时,我得到以下错误。我在编译代码时已经提到了类路径中的所有httpclient依赖项。请帮帮我。

14/07/28 08:16:40 INFO mapreduce.Job: Task Id : attempt_1405534657345_0008_m_000001_2, Status : FAILED
Error: java.lang.ClassNotFoundException: org.apache.http.impl.client.HttpClientBuilder
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.myorg.ExtractUrl.unshortenSingleLevel(ExtractUrl.java:80)
    at org.myorg.ExtractUrl.unshorten(ExtractUrl.java:118)
    at org.myorg.ExtractUrl$Map.map(ExtractUrl.java:40)
    at org.myorg.ExtractUrl$Map.map(ExtractUrl.java:27)
    at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
    at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:430)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)

0 个答案:

没有答案