我开始使用hadoop在aws上运行代码。但是,我在使用hadoop jar命令时遇到了错误:
Error: java.lang.ClassNotFoundException: com.opencsv.CSVParser
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at FlightsByCarrierMapper.map(FlightsByCarrierMapper.java:10)
at FlightsByCarrierMapper.map(FlightsByCarrierMapper.java:5)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:146)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
我在classpath和hadoop\u classpath中都包含了opencsv.jar,但仍然失败。我的hadoop版本是2.7.0和3.8。有人能帮帮我吗?
暂无答案!
目前还没有任何答案,快来回答吧!