在使用mapreduce运行jar包时,系统所有程序突然关闭。
我找不到log信息,就直接在eclipse中运行程序看是否有错,报错:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:59)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
at com.letsdobigdata.MaxTemperatureDriver.main(MaxTemperatureDriver.java:35)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
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:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
遇到这种错误后,判断jar包中有没有commons.cli的jar包,没有的话添加进去就好了