我是hadoop的新学员,我正在用maven打包tom white的hadoop指南(第四版)中的代码,我遇到了第22章代码的问题。它注意到“package org.apache.hadoop.record”不存在。
我在google上搜索了这个包,发现它已经被avro否决了。avro和其他相关软件包由maven安装。从下面的结果可以看出其他编译任务是成功的。
[INFO] 53 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Hadoop: The Definitive Guide, Project .............. SUCCESS [ 0.406 s]
[INFO] Common Code ........................................ SUCCESS [ 2.231 s]
[INFO] Chapter 2: MapReduce ............................... SUCCESS [ 0.194 s]
[INFO] Chapter 3: The Hadoop Distributed Filesystem ....... SUCCESS [ 0.398 s]
[INFO] Chapter 5: Hadoop I/O .............................. SUCCESS [ 0.376 s]
[INFO] Chapter 6: Developing a MapReduce Application ...... SUCCESS [ 0.336 s]
[INFO] Chapter 8: MapReduce Types and Formats ............. SUCCESS [ 0.651 s]
[INFO] Chapter 9: MapReduce Features ...................... SUCCESS [ 0.344 s]
[INFO] Chapter 12: Avro ................................... SUCCESS [ 5.353 s]
[INFO] Chapter 13: Parquet ................................ SUCCESS [ 1.922 s]
[INFO] Chapter 15: Sqoop .................................. SUCCESS [ 0.148 s]
[INFO] Chapter 16: Pig .................................... SUCCESS [ 0.173 s]
[INFO] Chapter 17: Hive ................................... SUCCESS [ 0.426 s]
[INFO] Chapter 18: Crunch ................................. SUCCESS [ 1.371 s]
[INFO] Chapter 19: Spark .................................. SUCCESS [ 13.280 s]
[INFO] Chapter 20: HBase .................................. SUCCESS [ 0.390 s]
[INFO] Chapter 21: ZooKeeper .............................. SUCCESS [ 0.090 s]
[INFO] Chapter 22: Case Studies ........................... FAILURE [ 0.196 s]
[INFO] Hadoop Examples JAR ................................ SKIPPED
[INFO] Snippet testing .................................... SKIPPED
[INFO] Hadoop: The Definitive Guide, Example Code ......... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.732 s
[INFO] Finished at: 2017-07-12T10:56:53+08:00
[INFO] Final Memory: 90M/360M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ch22-case-studies: Compilation failure: Compilation failure:
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[4,57] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[5,53] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[6,47] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[35,46] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[38,65] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[100,55] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[110,71] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[120,57] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[218,66] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[9,57] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[10,73] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[11,69] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[12,73] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[13,74] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[14,69] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[53,53] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[56,36] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[57,55] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[60,38] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[146,58] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[146,136] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[147,38] package org.apache.hadoop.record.meta does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[226,43] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[227,43] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[231,43] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[232,43] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[236,43] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[237,43] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[241,43] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[242,43] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[246,43] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[247,43] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[260,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[261,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[265,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[266,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[270,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[271,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[275,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[276,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[280,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[281,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[285,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[286,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[290,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[291,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[295,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[296,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[300,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[301,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[305,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[306,44] package org.apache.hadoop.record does not exist
[ERROR] /usr/local/hadoop/myclass/hadoop-book/ch22-case-studies/src/main/java/fm/last/hadoop/io/records/TrackStats.java:[321,29] package org.apache.hadoop.record does not exist
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :ch22-case-studies
在这里附上我的环境变量。
# JAVA
export JAVA_HOME=/usr/java/jdk1.8.0_131
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
# HADOOP
export HADOOP_HOME=/usr/local/hadoop
export HADOOP_INSTALL=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin
export HADOOP_CLASSPATH=/usr/local/hadoop/share/hadoop/common/hadoop-common-3.0.0-alpha3.jar:/usr/local/hadoop/myclass
# HIVE
export HIVE_INSTALL=/usr/local/hive
export PATH=$PATH:$HIVE_INSTALL/bin
有人能帮我解决这个问题吗?谢谢
暂无答案!
目前还没有任何答案,快来回答吧!