title: Unable to canonicalize address localhost/<unresolved>:2222 because it's not resolvable
body: <p>I want to connect Java with Hbase i get an error:
  java.lang.IllegalArgumentException: Unable to canonicalize address</p>
  <pre><code>localhost/&lt;unresolved&gt;:2222 because it's not resolvable
      at org.apache.zookeeper.SaslServerPrincipal.getServerPrincipal(SaslServerPrincipal.java:65)
      at org.apache.zookeeper.SaslServerPrincipal.getServerPrincipal(SaslServerPrincipal.java:41)
      at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1001)
      at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1060)
  </code></pre>
  <p>Here is my code:</p>
  <pre><code>    Configuration conf = HBaseConfiguration.create();
      conf.set(&quot;hbase.zookeeper.quorum&quot;, &quot;localhost&quot;);
      conf.set(&quot;hbase.rootdir&quot;, &quot;hdfs://localhost:9000/hbase&quot;);
      conf.set(&quot;hbase.cluster.distributed&quot;, &quot;hbase.cluster.distributed&quot;);
      conf.set(&quot;hbase.zookeeper.property.clientPort&quot;, &quot;2222&quot;);
      conf.set(&quot;hbase.zookeeper.property.dataDir&quot;, &quot;/home/trannguyenhan/app/hbase-2.4.2/zookeeper&quot;);
      conf.set(&quot;dfs.replication&quot;, &quot;1&quot;);
      
      HTable htable = new HTable(conf, &quot;demo&quot;);
      
      Put p = new Put(Bytes.toBytes(&quot;row1&quot;));
      p.add(Bytes.toBytes(&quot;demo_column&quot;), Bytes.toBytes(&quot;name&quot;), Bytes.toBytes(&quot;Nguyen Quang Huy&quot;));
      
      htable.put(p);
      htable.close();
  </code></pre>
  <p>my configurations are the same as those in the file hbase-site.xml.
  Can you help me, thanks you.</p>