title: Squirrel access to Phoenix/HBase
body: <p>I got phoenix 4.0 running on hbase 0.98/hadoop 2.3.0 and was impressed by the command line tools.</p>
  
  <p>In the second step I followed the description on the webpage to connect to phoenix using its bundled JDBC driver.</p>
  
  <p>When I try to connect I get the Exception message (on Squirrel side)</p>
  
  <pre><code>java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.sql.SQLException: ERROR 103 (08004): Unable to establish connection.
      at java.util.concurrent.FutureTask.report(Unknown Source)
      at java.util.concurrent.FutureTask.get(Unknown Source)
      at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
      at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
      at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  Caused by: java.lang.RuntimeException: java.sql.SQLException: ERROR 103 (08004): Unable to establish connection.
      at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:171)
      at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
      at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
      ... 5 more
  Caused by: java.sql.SQLException: ERROR 103 (08004): Unable to establish connection.
      at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:309)
      at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:133)
      at org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:254)
      at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1446)
      at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:131)
      at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:112)
      at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
      at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
      ... 7 more
  Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException
      at org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:416)
      at org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:309)
      at org.apache.phoenix.query.HConnectionFactory$HConnectionFactoryImpl.createConnection(HConnectionFactory.java:47)
      at org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:252)
      ... 12 more
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:414)
      ... 15 more
  Caused by: java.lang.RuntimeException: Socket Factory class not found: java.lang.ClassNotFoundException: Class org.apache.hadoop.net.StandardSocketFactory not found
      at org.apache.hadoop.net.NetUtils.getSocketFactoryFromProperty(NetUtils.java:142)
      at org.apache.hadoop.net.NetUtils.getDefaultSocketFactory(NetUtils.java:122)
      at org.apache.hadoop.hbase.ipc.RpcClient.&lt;init&gt;(RpcClient.java:1293)
      at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.&lt;init&gt;(HConnectionManager.java:664)
      ... 20 more
  </code></pre>
  
  <p>I double checked the jar files with classfinder to be sure that the class org.apache.hadoop.net.StandardSocketFactory IS in the classpath.</p>
  
  <p>What can I do to get Squirrel connected with Phoenix?</p>
  
  <p>Update:</p>
  
  <p>I saw in the zookeeper log on the server side that the network communication started:</p>
  
  <pre><code>2014-05-28 06:24:29,411 INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] server.NIOServerCnxnFactory: Accepted socket connection from /192.168.1.106:58172
  2014-05-28 06:24:29,412 INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] server.ZooKeeperServer: Client attempting to establish new session at /192.168.1.106:58172
  2014-05-28 06:24:29,518 INFO  [SyncThread:0] server.ZooKeeperServer: Established session 0x146413f6c3a000c with negotiated timeout 90000 for client /192.168.1.106:58172
  </code></pre>