简体   繁体   English

Eclipse MapReduce错误:UnModifiableMap

[英]Eclipse MapReduce Error: UnModifiableMap

so I'm new to Hadoop and MapReduce and am attempting to create a simple WordCount program. 因此,我是Hadoop和MapReduce的新手,正在尝试创建一个简单的WordCount程序。 When running it however, I run into an error: 但是,在运行它时,我遇到了一个错误:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/map/UnmodifiableMap
at org.apache.hadoop.conf.Configuration$DeprecationContext.<init>(Configuration.java:409)
at org.apache.hadoop.conf.Configuration.<clinit>(Configuration.java:448)
at com.Cameron.WordCount.main(WordCount.java:51)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.map.UnmodifiableMap
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)
... 3 more

I've had a look around online and the cause seems to be the fact that the Commons Collection JAR isn't included in the build path, although with mine it is and I'm still getting the error. 我在网上浏览了一下,原因似乎是Commons Collection JAR未包含在构建路径中,尽管我的却包含在内,但我仍然遇到错误。 I've tried cleaning the project and restarting Eclipse to no avail, so any help would be greatly appreciated. 我尝试清理项目并无济于事地重新启动Eclipse,所以任何帮助将不胜感激。 My build path configuration is as follows: 我的构建路径配置如下:

commons-collections4-4.1.jar
commons-lang-2.6.jar
commons-logging-1.2.jar
guava-11.0.2.jar
hadoop-common-2.7.2.jar
hadoop-mapreduce-client-core-2.7.2.jar
JRE System Library [JavaSE-1.7]

I have run into a similar error. 我遇到了类似的错误。 I am running through a tutorial on cloudera 5.8 using luna eclipse ( https://github.com/hortonworks/hadoop-tutorials/blob/master/Community/T09_Write_And_Run_Your_Own_MapReduce_Java_Program_Poll_Result_Analysis.md ). 我正在使用luna eclipse( https://github.com/hortonworks/hadoop-tutorials/blob/master/Community/T09_Write_And_Run_Your_Own_MapReduce_Java_Program_Poll_Result_Analysis.md )在cloudera 5.8上完成一个教程。

You need Apache Commons Collections » 3.2.1 (NOT 4.1), add it to your build path and it should run. 您需要Apache Commons Collections»3.2.1(NOT 4.1),将其添加到您的构建路径中,它应该可以运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM