title: Spark1.4.0 cannot connect to Hbase 1.1.0.1
body: <p>it raise the error </p>
  
  <blockquote>
    <p>Caused by: java.lang.NoSuchMethodError:
    org.apache.hadoop.hbase.util.Addressing.getIpAddress()Ljava/net/InetAddress;</p>
  </blockquote>
  
  <p>while I can success connect to hbase by using spark shell. could anyone knows where the problem is?</p>
  
  <p>the detail error</p>
  
  <pre><code>15/07/01 18:57:57 ERROR yarn.ApplicationMaster: User class threw exception: java.io.IOException: java.lang.reflect.InvocationTargetException
  java.io.IOException: java.lang.reflect.InvocationTargetException
      at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:240)
      at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:218)
      at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:119)
      at com.koudai.resys.tmp.HbaseLearning$.main(HbaseLearning.scala:22)
      at com.koudai.resys.tmp.HbaseLearning.main(HbaseLearning.scala)
      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.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:483)
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
      at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:238)
      ... 9 more
  Caused by: java.lang.NoSuchMethodError: org.apache.hadoop.hbase.util.Addressing.getIpAddress()Ljava/net/InetAddress;
      at org.apache.hadoop.hbase.client.ClientIdGenerator.getIpAddressBytes(ClientIdGenerator.java:83)
      at org.apache.hadoop.hbase.client.ClientIdGenerator.generateClientId(ClientIdGenerator.java:43)
      at org.apache.hadoop.hbase.client.PerClientRandomNonceGenerator.&lt;init&gt;(PerClientRandomNonceGenerator.java:37)
      at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.&lt;init&gt;(ConnectionManager.java:682)
      at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.&lt;init&gt;(ConnectionManager.java:630)
      ... 14 more
  </code></pre>
  
  <p>the sbt config:</p>
  
  <pre><code>libraryDependencies += "org.apache.spark" %% "spark-core" % "1.4.0" % "provided"
  libraryDependencies += "org.apache.spark" %% "spark-mllib" % "1.4.0" % "provided"
  libraryDependencies += "org.apache.hbase" % "hbase" % "1.1.0.1"
  libraryDependencies += "org.apache.hbase" % "hbase-client" % "1.1.0.1"
  libraryDependencies += "org.apache.hbase" % "hbase-common" % "1.1.0.1"
  libraryDependencies += "org.apache.hbase" % "hbase-server" % "1.1.0.1"
  libraryDependencies += "org.apache.hbase" % "hbase-hadoop2-compat" % "1.1.0.1"
  </code></pre>
  
  <p>the running code:</p>
  
  <blockquote>
  <pre><code>    val sc =  new SparkConf().setAppName("hbase@user")
      val conf = HBaseConfiguration.create()
      conf.set("hbase.zookeeper.property.clientPort", "2181")
      conf.set("hbase.zookeeper.quorum", "idc02-rs-sfa-10")
  
      // the error raised from here
      val conn = ConnectionFactory.createConnection(conf)
  </code></pre>
  </blockquote>
  
  <p>using reflection to list the methods for org.apache.hadoop.hbase.util.Addressing found it is hbase 0.94 version, where could be it from?</p>
  
  <pre><code>parsePort
  createHostAndPortStr
  createInetSocketAddressFromHostAndPortStr
  getIpAddress
  getIp4Address
  getIp6Address
  parseHostname
  isLocalAddress
  wait
  wait
  wait
  equals
  toString
  hashCode
  getClass
  notify
  notifyAll  
  </code></pre>