diff --git a/ql/src/java/org/apache/hadoop/hive/ql/session/DependencyResolver.java b/ql/src/java/org/apache/hadoop/hive/ql/session/DependencyResolver.java index 27bf3e4..b20e975 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/session/DependencyResolver.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/session/DependencyResolver.java @@ -20,6 +20,7 @@ import java.net.URI; import java.net.URISyntaxException; +import java.net.URL; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; @@ -58,8 +59,11 @@ public DependencyResolver() { // If HIVE_HOME is not defined or file is not found in HIVE_HOME/conf then load default ivysettings.xml from class loader if (ivysettingsPath == null || !(new File(ivysettingsPath).exists())) { - ivysettingsPath = ClassLoader.getSystemResource("ivysettings.xml").getFile(); - _console.printInfo("ivysettings.xml file not found in HIVE_HOME or HIVE_CONF_DIR," + ivysettingsPath + " will be used"); + URL ivysetttingsResource = ClassLoader.getSystemResource("ivysettings.xml"); + if (ivysetttingsResource != null){ + ivysettingsPath = ivysetttingsResource.getFile(); + _console.printInfo("ivysettings.xml file not found in HIVE_HOME or HIVE_CONF_DIR," + ivysettingsPath + " will be used"); + } } }