在将mahout与map reduce程序集成时,我在解析XML时遇到了这个错误



运行程序时出现以下错误。知道吗?

Caused by: java.lang.NoClassDefFoundError: com/google/common/base/Charsets
            at org.apache.mahout.text.wikipedia.XmlInputFormat$XmlRecordReader.<init>(XmlInputFormat.java:76)
            at org.apache.mahout.text.wikipedia.XmlInputFormat.createRecordReader(XmlInputFormat.java:52)
            at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:488)
            at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:731)
            at org.apache.hadoop.mapred.MapTask.run(MapTask.java:364)
            at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:223)
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
            at java.util.concurrent.FutureTask.run(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)
        Caused by: java.lang.ClassNotFoundException: com.google.common.base.Charsets
            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 sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)*

在包下找不到类。尝试提取jar文件&遍历到com/google/common/base包。我觉得缺课了。使用另一个具有字符集

的jar文件

相关内容

  • 没有找到相关文章

最新更新