HIVE-9566: HiveServer2 fails to start with NullPointerException (Na via Xuefu)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/97b4750c Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/97b4750c Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/97b4750c Branch: refs/heads/llap Commit: 97b4750c6314eea9025b426e4df73f795b601927 Parents: 8ed3377 Author: Xuefu Zhang <xzh...@cloudera.com> Authored: Tue Jun 30 05:15:40 2015 -0700 Committer: Xuefu Zhang <xzh...@cloudera.com> Committed: Tue Jun 30 05:15:40 2015 -0700 ---------------------------------------------------------------------- .../src/java/org/apache/hive/service/server/HiveServer2.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/97b4750c/service/src/java/org/apache/hive/service/server/HiveServer2.java ---------------------------------------------------------------------- diff --git a/service/src/java/org/apache/hive/service/server/HiveServer2.java b/service/src/java/org/apache/hive/service/server/HiveServer2.java index 00ab75f..4a4be97 100644 --- a/service/src/java/org/apache/hive/service/server/HiveServer2.java +++ b/service/src/java/org/apache/hive/service/server/HiveServer2.java @@ -317,7 +317,7 @@ public class HiveServer2 extends CompositeService { } } // Remove this server instance from ZooKeeper if dynamic service discovery is set - if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_SUPPORT_DYNAMIC_SERVICE_DISCOVERY)) { + if (hiveConf != null && hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_SUPPORT_DYNAMIC_SERVICE_DISCOVERY)) { try { removeServerInstanceFromZooKeeper(); } catch (Exception e) { @@ -326,7 +326,7 @@ public class HiveServer2 extends CompositeService { } // There should already be an instance of the session pool manager. // If not, ignoring is fine while stopping HiveServer2. - if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_TEZ_INITIALIZE_DEFAULT_SESSIONS)) { + if (hiveConf != null && hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_TEZ_INITIALIZE_DEFAULT_SESSIONS)) { try { TezSessionPoolManager.getInstance().stop(); } catch (Exception e) { @@ -335,7 +335,7 @@ public class HiveServer2 extends CompositeService { } } - if (hiveConf.getVar(ConfVars.HIVE_EXECUTION_ENGINE).equals("spark")) { + if (hiveConf != null && hiveConf.getVar(ConfVars.HIVE_EXECUTION_ENGINE).equals("spark")) { try { SparkSessionManagerImpl.getInstance().shutdown(); } catch(Exception ex) {