一、异常现象
在kylin的web管理界面,设置hive数据源时,报错:
查找kylin的日志时发现,弹出提示框的原因是因为出现错误:
ERROR [http-bio-7070-exec-10] controller.TableController:189 : org/apache/hadoop/hive/conf/HiveConf java.lang.NoClassDefFoundError: org/apache/hadoop/hive/conf/HiveConf
二、异常原因
原因是hive的lib没有加载进来
三、异常解决
1.配置环境变量
加入以下红色部分
# 1. java export JAVA_HOME=/usr/java/jdk1.7.0_80 export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar # 2. Tomcat #export CATALINA_HOME=/developer/apache-tomcat-7.0.73 #export CATALINA_HOME=/developer/saiku-server/tomcat export CATALINA_HOME=/developer/apache-kylin-2.3.0-bin/tomcat # 3. Maven export MAVEN_HOME=/developer/apache-maven-3.0.5 # 4. hadoop export HADOOP_HOME=/developer/hadoop-2.6.0 # 5. hbase export HBASE_HOME=/developer/hbase-1.2.0 # 6. hive export HIVE_HOME=/developer/apache-hive-1.1.0-bin export HIVE_CONF_DIR=${HIVE_HOME}/conf export HCAT_HOME=$HIVE_HOME/hcatalog # 7. kylin export KYLIN_HOME=/developer/apache-kylin-2.3.0-bin export hive_dependency=$HIVE_HOME/conf:$HIVE_HOME/lib/*:$HCAT_HOME/share/hcatalog/hive-hcatalog-core-1.1.0.jar #Path # 1. big data export PATH=$KYLIN_HOME/bin:$PATH export PATH=$HIVE_HOME/bin:$HBASE_HOME/bin:$HADOOP_HOME/bin:$PATH export PATH=$MAVEN_HOME/bin:$CATALINA_HOME/bin:$JAVA_HOME/bin:$PATH export LC_ALL=en_US.UTF-8
2.配置 kylin.sh
在文件开始的地方,添加如下配置:
export KYLIN_HOME=/developer/apache-kylin-2.3.0-bin
export HBASE_CLASSPATH_PREFIX=$CATALINA_HOME/bin/bootstrap.jar:$CATALINA_HOME/bin/tomcat-juli.jar:$CATALINA_HOME/lib/*:$hive_dependency:$HBASE_CLASSPATH_PREFIX