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

Phoenix JDBC unable to connect using SQuirrel

Highlighted

Phoenix JDBC unable to connect using SQuirrel

Explorer

I've been tearing my hair out trying to connect SQuirrel to Phoenix.

Can anyone give me any ideas?

TL;DR version

Testing the connection gives this error:

java.lang.RuntimeException: java.lang.RuntimeException: hbase-default.xml file seems to be for an older version of HBase (1.1.2.2.3.2.0-2950), this version is Unknown

I don't have and can't find a hbase-default.xml

End TL;DR version

Server Cluster Info

Centos 7

HBase 1.1

Phoenix 4.4

I can connect to Phoenix via command line phoenix-sqlline node1,node2,node3:2181:/hbase-unsecure

Client Info

Windows Server 2012 VPN connection to cluster

I can access Ambari, Nifi, MemSQL, etc. all installed on cluster computers.

I verified that I can talk to Zookeeper from the client computer.

SQurrel 3.7 Config:

Extra Class Path (in that order, jars taken from cluster computers):

hbase-client-1.1.2.2.3.2.0-2950.jar

phoenix-4.4.0.2.3.2.0-2950-client.jar

Class Name:

org.apache.phoenix.jdbc.PhoenixDriver

JDBC connection string:

jdbc:phoenix:node1,node2,node3:2181:/hbase-unsecure

Username: tried various, including blank, nothing was necessary on phoenix-sqlline

Password: tried various, including blank

Clicking test gives the following stack trace:

ava.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.RuntimeException: hbase-default.xml file seems to be for an older version of HBase (1.1.2.2.3.2.0-2950), this version is Unknown 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.lang.RuntimeException: hbase-default.xml file seems to be for an older version of HBase (1.1.2.2.3.2.0-2950), this version is Unknown at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:175) 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.lang.RuntimeException: hbase-default.xml file seems to be for an older version of HBase (1.1.2.2.3.2.0-2950), this version is Unknown at org.apache.hadoop.hbase.HBaseConfiguration.checkDefaultsVersion(HBaseConfiguration.java:71) at org.apache.hadoop.hbase.HBaseConfiguration.addHbaseResources(HBaseConfiguration.java:81) at org.apache.hadoop.hbase.HBaseConfiguration.create(HBaseConfiguration.java:96) at org.apache.phoenix.query.ConfigurationFactory$ConfigurationFactoryImpl$1.call(ConfigurationFactory.java:49) at org.apache.phoenix.query.ConfigurationFactory$ConfigurationFactoryImpl$1.call(ConfigurationFactory.java:46) at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:77) at org.apache.phoenix.util.PhoenixContextExecutor.callWithoutPropagation(PhoenixContextExecutor.java:92) at org.apache.phoenix.query.ConfigurationFactory$ConfigurationFactoryImpl.getConfiguration(ConfigurationFactory.java:46) at org.apache.phoenix.query.QueryServicesOptions.withDefaults(QueryServicesOptions.java:219) at org.apache.phoenix.query.QueryServicesImpl.<init>(QueryServicesImpl.java:36) at org.apache.phoenix.jdbc.PhoenixDriver.getQueryServices(PhoenixDriver.java:130) at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:163) at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:132) at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:151) 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

9 REPLIES 9
Highlighted

Re: Phoenix JDBC unable to connect using SQuirrel

Try setting hbase.defaults.for.version.skip to "true" in hbase-site.xml

Highlighted

Re: Phoenix JDBC unable to connect using SQuirrel

Super Collaborator

Please try to remove hbase-client.jar from the Squirrel classpath. Phoenix-client.jar contains all required dependencies.

Highlighted

Re: Phoenix JDBC unable to connect using SQuirrel

Explorer

@jelser -> hbase.defaults.for.version.skip is set to "true" in hbase-site.xml. If I put that file in my classpath, I get a different error:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseIOException 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.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseIOException at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:175) 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.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseIOException at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:170) at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:132) at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:151) 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.lang.ClassNotFoundException: org.apache.hadoop.hbase.HBaseIOException at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 37 more

Highlighted

Re: Phoenix JDBC unable to connect using SQuirrel

phoenix-4.4.0.2.3.2.0-2950-client.jar should already have that class in it (try `jar tf phoenix-4.4.0.2.3.2.0-2950-client.jar | fgrep HBaseIOException` to check).

Highlighted

Re: Phoenix JDBC unable to connect using SQuirrel

Explorer

This is the response. Looks like it's present:

org/apache/hadoop/hbase/HBaseIOException.class

Highlighted

Re: Phoenix JDBC unable to connect using SQuirrel

Hrm. Not sure what to tell you then. Certainly looks like SQuirreL should have access to that class. Maybe, double check its classpath?

Highlighted

Re: Phoenix JDBC unable to connect using SQuirrel

Explorer

@ssoldatov - if I remove the hbase-client.jar from the classpath, I get a different error as well:

java.util.concurrent.TimeoutException 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)

Highlighted

Re: Phoenix JDBC unable to connect using SQuirrel

Super Collaborator

Could you please check the RS logs for any kind of exceptions. It seems that the client is unable to connect and it's not clear on which side the problem is.

Re: Phoenix JDBC unable to connect using SQuirrel

Explorer

I was able to use NiFi with the same drivers within the cluster to insert records directly to Phoenix, so with that and phoenix-sqlline also working, our current thinking is that there must be some port that the firewall is blocking.

Don't have an account?
Coming from Hortonworks? Activate your account here