balancer.Balancer: java.lang.NullPointerException while HADOOP_CONF_DIR is empty or wrong -----------------------------------------------------------------------------------------
Key: HDFS-2220 URL: https://issues.apache.org/jira/browse/HDFS-2220 Project: Hadoop HDFS Issue Type: Bug Components: balancer Affects Versions: 0.20.204.0 Reporter: Rajit When HADOOP_CONF_DIR is empty or wrongly set and balancer is called without proper --config , in clientside STDOUT we get NPE. $ echo $HADOOP_CONF_DIR $ hadoop balancer Balancing took 46.0 milliseconds 11/06/13 05:14:04 ERROR balancer.Balancer: java.lang.NullPointerException at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:136) at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:176) at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:206) at org.apache.hadoop.hdfs.server.namenode.NameNode.getServiceAddress(NameNode.java:200) at org.apache.hadoop.hdfs.server.balancer.Balancer.createNamenode(Balancer.java:911) at org.apache.hadoop.hdfs.server.balancer.Balancer.init(Balancer.java:860) at org.apache.hadoop.hdfs.server.balancer.Balancer.run(Balancer.java:1475) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65) at org.apache.hadoop.hdfs.server.balancer.Balancer.main(Balancer.java:811) I think it would be good to give more meaningful error messege instead of NPE -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira