1. 程式人生 > >java.lang.ClassNotFoundException: 自己編譯WordCount編譯通過執行報錯

java.lang.ClassNotFoundException: 自己編譯WordCount編譯通過執行報錯

1、使用WordCount原始碼,修改其Map,在Map中使用IKAnalyzer的分詞功能。原始碼參照:

http://www.cnblogs.com/jiejue/archive/2012/12/16/2820788.html

2、打包上傳到Hadoop叢集,每臺機器都上傳,上傳時包含了所有相關的jar,放到一個目錄下

3、按如下兩種方式執行都報錯

[[email protected] wordcount]$ /opt/modules/hadoop/hadoop-1.0.3/bin/hadoop jar ChineseWordCount.jar  /user/root/hadoop/ /output6
Exception in thread "main" java.lang.ClassNotFoundException: /user/root/hadoop/
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
[

[email protected] wordcount]$ /opt/modules/hadoop/hadoop-1.0.3/bin/hadoop jar ChineseWordCount.jar  ChineseWordCount /user/root/hadoop/ /output6
Exception in thread "main" java.lang.ClassNotFoundException: WordCount
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.hadoop.util.RunJar.main(RunJar.java:149)

4、解決辦法:ChineseWordCount增加名稱空間;~~~都是預設示例惹的禍,預設示例[[email protected] hadoop-1.0.3]$hadoop jar hadoop-examples-1.0.3.jar  wordcount /user/root/hadoop/ /output5 執行成功。

正確執行命令:[[email protected] wordcount]$ /opt/modules/hadoop/hadoop-1.0.3/bin/hadoop jar ChineseWordCount.jar  org.apache.hadoop.examples.ChineseWordCount /user/root/hadoop/ /output6

相關推薦

java.lang.ClassNotFoundException: 自己編譯WordCount編譯通過執行

1、使用WordCount原始碼,修改其Map,在Map中使用IKAnalyzer的分詞功能。原始碼參照: http://www.cnblogs.com/jiejue/archive/2012/12/16/2820788.html 2、打包上傳到Hadoop叢集,每臺機器都

Caused by java.lang.IllegalStateException Not allowed to start service Intent問題分析

Caused by: java.lang.IllegalStateException: Not allowed to start service Intent Caused by: java.lang.IllegalStateException: Not allowed to start

關於java.lang.NumberFormatException: For input string:${redis.maxIdle}的

仔細分析後: 原來是在測試時,沒有匯入redis.properties檔案,value把 r e

【解決】自己編寫Wordcount程式碼上傳叢集上執行時報:Exception in thread "main" java.lang.ClassNotFoundException: WordCount

報錯資訊:ClassNotFoundException: WordCount [[email protected] fs_testdir]# hadoop jar /fs_testdir/my

idea之旅(編譯java程式碼出現java.lang.ClassNotFoundException: com.sun.tools.javac.api.JavacTool)

錯誤如下:Error:java: System Java Compiler was not found in classpath: java.lang.ClassNotFoundException: com.sun.tools.javac.api.JavacTool

eclipse下執行wordcount java.lang.ClassNotFoundException 解決辦法

eclipse下執行wordcount報錯 java.lang.classnotfoundexception 解決辦法eclipse下執行wordcount報錯 java.lang.ClassNotFoundException17/08/29 07:52:54 INFO Configuration.depre

Exception in thread "main" java.lang.ClassNotFoundException: WordCount

出現這個問題主要是呼叫的問題,沒有加入包./bin/hadoop jar FirstJar/WordCount.jar WordCount input output改成如下的樣子就可以了./bin/hadoop jar FirstJar/WordCount.jar cn.edu.ruc.cloud

java.lang.ClassNotFoundException: Class WordCount$TokenizerMapper not found

長時間沒學習,重新除錯mapreduce程式WordCount的時候,以前寫好並除錯通過的程式出問題了,報錯如下: Error: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class

java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener

java lang class <!-- 導入java ee jar 包 --> <dependency> <groupId>javax</groupId> <artif

Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor

previous webapp contain com ssd not error efault pro 1、錯誤描寫敘述 三月 15, 2015 6:50:23 下午 org.apache.catalina.core.StandardContext filterSt

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

frame rtu tex catalina 導入 listen 前言 intern 初步 前言:   MyEclipse整合ssh框架,間歇性Tomcat啟動發生java.lang.ClassNotFoundException: org.springframework.w

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver 解決方法

connector cor engine 結果 coyote ogl err jdbc ont 今天用 myeclipse 寫了個工程。結果最後報錯,錯誤信息如下: java.lang.ClassNotFoundException: com.mysql.jdbc.Drive

【web.xml】java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

sch display ldr cep .class apache blog man reload 今天搭建新的項目,雖然在web.xml中配置了ContextLoaderListener以及IntrospectorCleanupListener 如下: web.xml中部

對象逆序列化java.lang.ClassNotFoundException

http 上網 security ref targe lin 存在 lan dcl 簡單的想從保存的對象中又一次解析出對象。用了逆序列化,但是報錯: java.lang.ClassNotFoundException: xxxxxxxxxxxx at java.net.U

java.lang.ClassNotFoundException: org.springframework.web.content.ContextLoaderListener

pla nag sdn fonts b2c dsm exc span fontsize 1、錯誤描寫敘述嚴重: Error configuring application listener of class org.springframework.web.content

java web 工程找不到tomcat類 java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

ood cep 找不到 otf 技術分享 .get http except 分享 ava.lang.ClassNotFoundException: com.mysql.jdbc.Driverat org.apache.catalina.loader.WebappClassL

java.lang.ClassNotFoundException: org.jaxen.JaxenException

chain intern tle current nco ews exce rip handle java.lang.ClassNotFoundException: org.jaxen.JaxenException java.lang.ClassNot

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

name class ava jdbc conn 拷貝 sql http img 解決方案: 在java項目中,只需要引入mysql-connector-java-5.1.7-bin.jar就可以運行java項目。 在web項目中,當Class.forName("om.m

eclipse運行maven項目java.lang.ClassNotFoundException: xxxxxx

java maven tomcat classnotfoundexception 在eclipse中運行maven項目,出現異常——java.lang.ClassNotFoundException: org.apache.shiro.web.env.EnvironmentLoaderLi

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

ica ror server acc dwr comm erro tor reads 七月 28, 2017 11:06:33 下午 org.apache.catalina.core.StandardWrapperValve invoke嚴重: Servlet.serv