Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Can't connect phoenix with jdbc


Can't connect phoenix with jdbc

New Contributor


I have two servert application,one servlet Application is in the same lan with hbase cluster, this can work. can conect

the other is not in the same lan wiht hbase cluster,but can use vpn connect hbase cluster, but this servelt application cant

connect hbase cluter. the error followers, why?who can help me ? too strange

my connect string is jdbc:phoenix:

The error is;

Caused by: org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=SYSTEM.CATALOG at org.apache.phoenix.query.ConnectionQueryServicesImpl.getAllTableRegions( ~[ConnectionQueryServicesImpl.class:] at org.apache.phoenix.query.ConnectionQueryServicesImpl.checkClientServerCompatibility( ~[ConnectionQueryServicesImpl.class:] at org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated( ~[ConnectionQueryServicesImpl.class:] at org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable( ~[ConnectionQueryServicesImpl.class:] at org.apache.phoenix.query.DelegateConnectionQueryServices.createTable( ~[DelegateConnectionQueryServices.class:] at org.apache.phoenix.schema.MetaDataClient.createTableInternal( ~[MetaDataClient.class:] at org.apache.phoenix.schema.MetaDataClient.createTable( ~[MetaDataClient.class:] at org.apache.phoenix.compile.CreateTableCompiler$2.execute( ~[CreateTableCompiler$2.class:] at org.apache.phoenix.jdbc.PhoenixStatement$ ~[PhoenixStatement$2.class:] at org.apache.phoenix.jdbc.PhoenixStatement$ ~[PhoenixStatement$2.class:] at ~[CallRunner.class:] at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation( ~[PhoenixStatement.class:] at org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate( ~[PhoenixStatement.class:] at org.apache.phoenix.query.ConnectionQueryServicesImpl$ ~[ConnectionQueryServicesImpl$12.class:] at org.apache.phoenix.query.ConnectionQueryServicesImpl$ ~[ConnectionQueryServicesImpl$12.class:] at ~[PhoenixContextExecutor.class:] at org.apache.phoenix.query.ConnectionQueryServicesImpl.init( ~[ConnectionQueryServicesImpl.class:] at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices( ~[PhoenixDriver.class:] at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect( ~[PhoenixEmbeddedDriver.class:] at org.apache.phoenix.jdbc.PhoenixDriver.connect( ~[PhoenixDriver.class:] at org.apache.commons.dbcp.DriverConnectionFactory.createConnection( ~[DriverConnectionFactory.class:1.4] at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject( ~[PoolableConnectionFactory.class:1.4] at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory( ~[BasicDataSource.class:1.4] at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory( ~[BasicDataSource.class:1.4] ... 30 more


Re: Can't connect phoenix with jdbc

New Contributor

Is this the first time you access phoenix? If so, it might be the case that you are accessing with a user that does not have permissions to create table. The first time that phoenix is accessed it tries to create system tables, which are necessary for the internal functioning. It could also be the case that the user doesn't have permissions to read from system.catalog, which might lead to this error too. In order to solve this, you should access hbase with sudo permissions and check if the tables exists. If they do, then grant them access to whichever users you need by adding them to hbase:acl table. If the tables do not exist, my recommendation is that you try to access phoenix with hbase sudo user at least once, so that the tables would be automatically created for you.

Re: Can't connect phoenix with jdbc

Super Guru

Does the user have access to the underlying HBase?

Is there permissions required?

Can you access HBase?

Can you access anything else on the cluster from that machine?

Firewall issue?

Did you try with sqlline?

Re: Can't connect phoenix with jdbc

@pan bocun

I was facing same kind of issue. I have resolve this issue by using following steps:-

1) Edit Ambari->Hive->Configs->Advanced->Custom hive-site->Add Property..., add the following properties based on your HBase configurations(you can search in Ambari->HBase->Configs): custom hive-site.xml

hbase.zookeeper.quorum=xyz (find this property value from hbase )

zookeeper.znode.parent=/hbase-unsecure (find this property value from hbase )



2) Copy jar to /usr/hdp/current/hive-server2/auxlib from


/usr/hdp/ If he jar is not working for you then just try to get following jar phoenix-hive- and copy this to /usr/hdp/current/hive-server2/auxlib

3) add property to custom-hive-env

HIVE_AUX_JARS_PATH=/usr/hdp/current/hive-server2/auxlib/4) Add follwoing property to custom-hbase-site.xmlphoenix.schema.mapSystemTablesToNamespace=true phoenix.schema.isNamespaceMappingEnabled=true

5) Also run following command

1) jar uf /usr/hdp/current/hive-server2/auxlib/phoenix- /etc/hive/conf/hive-site.xml

2) jar uf /usr/hdp/current/hive-server2/auxlib/phoenix- /etc/hbase/conf/hbase-site.xml

And I hope my solution will work for you :)