hive-site.xml not found on classpath

2019-05-15 16:25发布

问题:

while running giraph hiverunner i get following error regarding classpath related to hive-site.xml, i have already set hive-env.sh, and bash.bashrc, but error is still coming.. any help how to set classpath and resolve this error..?? any thing else i need to modify..??

i have already tried hivejdbc ex its executes without any error.. but while working hadoop with jars gives error..

will be great full for any help..

13/01/16 11:58:23 WARN conf.HiveConf: hive-site.xml not found on CLASSPATH
Exception in thread "main" java.lang.NullPointerException
    at org.apache.giraph.io.hcatalog.HiveGiraphRunner.adjustConfigurationForHive(HiveGiraphRunner.java:212)
    at org.apache.giraph.io.hcatalog.HiveGiraphRunner.run(HiveGiraphRunner.java:164)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
    at org.apache.giraph.io.hcatalog.HiveGiraphRunner.main(HiveGiraphRunner.java:147)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:197)

回答1:

Did you set on Hadoops classpath as well? In hadoop-env.sh there is as line export HADOOP_CLASSPATH=. Uncomment it and add Hives conf and lib folder to it. That does it for me.



回答2:

Add export HADOOP_CLASSPATH= $HIVE_HOME/conf:$HIVE_HOME/lib in bash_rc or bash_profile