0

I am new to HBase and Phoenix, and I have faced an issue with the Phoenix JDBC program in Java.

I have some sample data in a Phoenix table, and I have written a Java code to draw the data out into the console with a select statement. My connection string is:jdbc:phoenix:localhost:2181 and the JDBC class I am using is :org.apache.phoenix.jdbc.PhoenixDriver.

While running the program I am getting an error:

java.lang.NoClassDefFoundError: org/cloudera/htrace/Sampler

What jar file am I missing here?

2 Answers2

0

Looks like jar file is missing in lib . add the jar or add in maven dependency (if you are using maven). if its already there then check classpath of application.

TheSprinter
  • 1,523
  • 17
  • 30
  • The problem is I cannot find the jar file the program is asking for. I have added Hadoop,Hbase and Phoenix libraries and I am sure most of them are not required. Can you point me out which Jar file exactly I am missing? – Ranit Dholey May 29 '18 at 13:19
  • htrace-core-2.00.jar use the appropriate version. htrace-1.45.jar this jar also contains same. check the version before using – TheSprinter May 29 '18 at 13:25
0

I have found the jar the program was asking for from the maven repository https://mvnrepository.com/artifact/org.cloudera.htrace/htrace/1.46 Exact name of the JAR would be htrace-1.46.jar.